Recovered ExtendedListView; ExtendedListFragment updated to handle to possible layouts
[pub/Android/ownCloud.git] / src / com / owncloud / android / datamodel / OCFile.java
index 222746b..78bdc84 100644 (file)
@@ -20,9 +20,9 @@ package com.owncloud.android.datamodel;
 
 import android.os.Parcel;
 import android.os.Parcelable;
-import android.webkit.MimeTypeMap;
 
 import com.owncloud.android.lib.common.utils.Log_OC;
+import com.owncloud.android.utils.FileStorageUtils;
 
 import java.io.File;
 
@@ -71,7 +71,6 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
     private boolean mNeedsUpdateThumbnail;
 
     private boolean mIsDownloading;
-    private boolean mIsUploading;
 
 
     /**
@@ -116,7 +115,6 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         mRemoteId = source.readString();
         mNeedsUpdateThumbnail = source.readInt() == 0;
         mIsDownloading = source.readInt() == 0;
-        mIsUploading = source.readInt() == 0;
 
     }
 
@@ -142,7 +140,6 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         dest.writeString(mRemoteId);
         dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0);
         dest.writeInt(mIsDownloading ? 1 : 0);
-        dest.writeInt(mIsUploading ? 1 : 0);
     }
 
     /**
@@ -356,7 +353,6 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         mRemoteId = null;
         mNeedsUpdateThumbnail = false;
         mIsDownloading = false;
-        mIsUploading = false;
     }
 
     /**
@@ -542,17 +538,7 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
      */
     public boolean isImage() {
         return ((mMimeType != null && mMimeType.startsWith("image/")) ||
-                getMimeTypeFromName().startsWith("image/"));
-    }
-
-    public String getMimeTypeFromName() {
-        String extension = "";
-        int pos = mRemotePath.lastIndexOf('.');
-        if (pos >= 0) {
-            extension = mRemotePath.substring(pos + 1);
-        }
-        String result = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
-        return (result != null) ? result : "";
+                FileStorageUtils.getMimeTypeFromName(mRemotePath).startsWith("image/"));
     }
 
     public String getPermissions() {
@@ -575,16 +561,12 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         return mIsDownloading;
     }
 
-    public boolean isUploading() {
-        return mIsUploading;
-    }
-
-    public void setUploading(boolean isUploading) {
-        this.mIsUploading = isUploading;
-    }
-
     public void setDownloading(boolean isDownloading) {
         this.mIsDownloading = isDownloading;
     }
 
+    public boolean isSynchronizing() {
+        // TODO real implementation
+        return false;
+    }
 }