private boolean mIsDownloading;
+ private boolean mInConflict;
+
/**
* Create new {@link OCFile} with given path.
mPublicLink = source.readString();
mPermissions = source.readString();
mRemoteId = source.readString();
- mNeedsUpdateThumbnail = source.readInt() == 0;
- mIsDownloading = source.readInt() == 0;
+ mNeedsUpdateThumbnail = source.readInt() == 1;
+ mIsDownloading = source.readInt() == 1;
+ mInConflict = source.readInt() == 1;
}
dest.writeString(mRemoteId);
dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0);
dest.writeInt(mIsDownloading ? 1 : 0);
+ dest.writeInt(mInConflict ? 1 : 0);
}
/**
mRemoteId = null;
mNeedsUpdateThumbnail = false;
mIsDownloading = false;
+ mInConflict = false;
}
/**
}
public void setEtag(String etag) {
- this.mEtag = etag;
+ this.mEtag = (etag != null ? etag : "");
}
-
public boolean isShareByLink() {
return mShareByLink;
}
getMimeTypeFromName().startsWith("image/"));
}
+ /**
+ * @return 'True' if the file is simple text (e.g. not application-dependent, like .doc or .docx)
+ */
+ public boolean isText() {
+ return ((mMimeType != null && mMimeType.startsWith("text/")) ||
+ getMimeTypeFromName().startsWith("text/"));
+ }
+
public String getMimeTypeFromName() {
String extension = "";
int pos = mRemotePath.lastIndexOf('.');
this.mIsDownloading = isDownloading;
}
- public boolean isSynchronizing() {
- // TODO real implementation
- return false;
+ public boolean isInConflict() {
+ return mInConflict;
+ }
+
+ public void setInConflict(boolean inConflict) {
+ mInConflict = inConflict;
}
}