+ dest.writeInt(mNeedsUpdating ? 1 : 0);
+ dest.writeLong(mLastSyncDate);
+ }
+
+ @Override
+ public int compareTo(OCFile another) {
+ if (isDirectory() && another.isDirectory()) {
+ return getRemotePath().toLowerCase().compareTo(another.getRemotePath().toLowerCase());
+ } else if (isDirectory()) {
+ return -1;
+ } else if (another.isDirectory()) {
+ return 1;
+ }
+ return getRemotePath().toLowerCase().compareTo(another.getRemotePath().toLowerCase());
+ }
+
+ public boolean equals(Object o) {
+ if(o instanceof OCFile){
+ OCFile that = (OCFile) o;
+ if(that != null){
+ return this.mId == that.mId;
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s]";
+ asString = String.format(asString, new Long(mId), getFileName(), mMimeType, isDownloaded(), mLocalPath, mRemotePath);
+ return asString;