+ return dateString.toString().split(",")[0];\r
+ }\r
+\r
+ /**\r
+ * Update the passed path removing the last "/" if it is not the root folder\r
+ * @param path\r
+ */\r
+ public static String getPathWithoutLastSlash(String path) {\r
+\r
+ // Remove last slash from path\r
+ if (path.length() > 1 && path.charAt(path.length()-1) == OCFile.PATH_SEPARATOR.charAt(0)) {\r
+ path = path.substring(0, path.length()-1);\r
+ }\r
+ return path;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param mFiles\r
+ * @return true: imageView, false: listView\r
+ */\r
+ public static boolean decideViewLayout(Vector<OCFile> mFiles){\r
+ // decide image vs. file view\r
+ double countImages = 0;\r
+ double countFiles = 0;\r
+\r
+ for (OCFile file : mFiles){\r
+ if (!file.isFolder()){\r
+ countFiles++;\r
+\r
+ if (file.isImage()){\r
+ countImages++;\r
+ }\r
+ }\r
+ }\r
+\r
+ if ((countImages / countFiles) >= THUMBNAIL_THRESHOLD){\r
+ return true;\r
+ } else {\r
+ return false;\r
+ }\r