Fixed bug: show the selected image in the gallery, instead of always the first in...
[pub/Android/ownCloud.git] / src / com / owncloud / android / datamodel / OCFile.java
index 0b581eb..c9e2b17 100644 (file)
@@ -454,8 +454,19 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         return 0;
     }
 
+    /** @return  'True' if the file contains audio */
     public boolean isAudio() {
-        return (mMimeType.startsWith("audio/"));
+        return (mMimeType != null && mMimeType.startsWith("audio/"));
+    }
+
+    /** @return  'True' if the file contains video */
+    public boolean isVideo() {
+        return (mMimeType != null && mMimeType.startsWith("video/"));
+    }
+
+    /** @return  'True' if the file contains an image */
+    public boolean isImage() {
+        return (mMimeType != null && mMimeType.startsWith("image/"));
     }
 
 }