+\r
+ return dots + urlNoDots.substring(0, hostStart) + host + urlNoDots.substring(hostEnd);\r
+ } else {\r
+ return dots + url;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Get the file extension if it is on path as type "content://.../DocInfo.doc"\r
+ * @param filepath: Content Uri converted to string format\r
+ * @return String: fileExtension (type '.pdf'). Empty if no extension\r
+ */\r
+ public static String getComposedFileExtension(String filepath) {\r
+ String fileExtension = "";\r
+ String fileNameInContentUri = filepath.substring(filepath.lastIndexOf("/"));\r
+\r
+ // Check if extension is included in uri\r
+ int pos = fileNameInContentUri.lastIndexOf('.');\r
+ if (pos >= 0) {\r
+ fileExtension = fileNameInContentUri.substring(pos);\r
+ }\r
+ return fileExtension;\r
+ }\r
+\r
+ @SuppressWarnings("deprecation")\r
+ public static CharSequence getRelativeDateTimeString (\r
+ Context c, long time, long minResolution, long transitionResolution, int flags\r
+ ){\r
+ \r
+ CharSequence dateString = "";\r
+ \r
+ // in Future\r
+ if (time > System.currentTimeMillis()){\r
+ return DisplayUtils.unixTimeToHumanReadable(time);\r
+ } \r
+ // < 60 seconds -> seconds ago\r
+ else if ((System.currentTimeMillis() - time) < 60 * 1000) {\r
+ return c.getString(R.string.file_list_seconds_ago);\r