Merge remote-tracking branch 'remotes/upstream/master' into beta
[pub/Android/ownCloud.git] / src / com / owncloud / android / datamodel / OCFile.java
index 5b84380..1c2ec26 100644 (file)
@@ -31,13 +31,11 @@ import java.io.File;
 import third_parties.daveKoeller.AlphanumComparator;
 public class OCFile implements Parcelable, Comparable<OCFile> {
 
-    public static final Parcelable.Creator<OCFile> CREATOR = new Parcelable.Creator<OCFile>() {
-        @Override
+    public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
         public OCFile createFromParcel(Parcel source) {
             return new OCFile(source);
         }
 
-        @Override
         public OCFile[] newArray(int size) {
             return new OCFile[size];
         }
@@ -74,6 +72,8 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
 
     private boolean mIsDownloading;
 
+    private boolean mShowGridView;
+
 
     /**
      * Create new {@link OCFile} with given path.
@@ -548,6 +548,14 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
                 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<OCFile> {
         return (result != null) ? result : "";
     }
 
+    /**
+     * @return 'True' if the file is hidden
+     */
+    public boolean isHidden() {
+        return getFileName().startsWith(".");
+    }
+
     public String getPermissions() {
         return mPermissions;
     }