X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/ae0e116ffc620bb9c5c94f1a9a24a5500e89bd8f..fc40765890415abe9f2569a44adcbe88412ea1ba:/src/com/owncloud/android/datamodel/OCFile.java diff --git a/src/com/owncloud/android/datamodel/OCFile.java b/src/com/owncloud/android/datamodel/OCFile.java index 5b843805..4baf1ea5 100644 --- a/src/com/owncloud/android/datamodel/OCFile.java +++ b/src/com/owncloud/android/datamodel/OCFile.java @@ -548,6 +548,14 @@ public class OCFile implements Parcelable, Comparable { 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('.'); @@ -559,6 +567,13 @@ public class OCFile implements Parcelable, Comparable { return (result != null) ? result : ""; } + /** + * @return 'True' if the file is hidden + */ + public boolean isHidden() { + return getFileName().startsWith("."); + } + public String getPermissions() { return mPermissions; }