Merge branch 'zmatsuo-detailThumbnail' into develop
[pub/Android/ownCloud.git] / src / com / owncloud / android / datamodel / OCFile.java
index 5b84380..4baf1ea 100644 (file)
@@ -548,6 +548,14 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
                 getMimeTypeFromName().startsWith("image/"));
     }
 
                 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('.');
     public String getMimeTypeFromName() {
         String extension = "";
         int pos = mRemotePath.lastIndexOf('.');
@@ -559,6 +567,13 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         return (result != null) ? result : "";
     }
 
         return (result != null) ? result : "";
     }
 
+    /**
+     * @return 'True' if the file is hidden
+     */
+    public boolean isHidden() {
+        return getFileName().startsWith(".");
+    }
+
     public String getPermissions() {
         return mPermissions;
     }
     public String getPermissions() {
         return mPermissions;
     }