+    \r
+    /**\r
+     * Converts an internationalized domain name (IDN) in an URL to and from ASCII/Unicode.\r
+     * @param url the URL where the domain name should be converted\r
+     * @param toASCII if true converts from Unicode to ASCII, if false converts from ASCII to Unicode\r
+     * @return the URL containing the converted domain name\r
+     */\r
+    @TargetApi(Build.VERSION_CODES.GINGERBREAD)\r
+    public static String convertIdn(String url, boolean toASCII) {\r
+\r
+        String urlNoDots = url;\r
+        String dots="";\r
+        while (urlNoDots.startsWith(".")) {\r
+            urlNoDots = url.substring(1);\r
+            dots = dots + ".";\r
+        }\r
+\r
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {\r
+            // Find host name after '//' or '@'\r
+            int hostStart = 0;\r
+            if  (urlNoDots.indexOf("//") != -1) {\r
+                hostStart = url.indexOf("//") + "//".length();\r
+            } else if (url.indexOf("@") != -1) {\r
+                hostStart = url.indexOf("@") + "@".length();\r
+            }\r
+\r
+            int hostEnd = url.substring(hostStart).indexOf("/");\r
+            // Handle URL which doesn't have a path (path is implicitly '/')\r
+            hostEnd = (hostEnd == -1 ? urlNoDots.length() : hostStart + hostEnd);\r
+\r
+            String host = urlNoDots.substring(hostStart, hostEnd);\r
+            host = (toASCII ? IDN.toASCII(host) : IDN.toUnicode(host));\r
+\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
+        } else {\r
+            // Workaround 2.x bug (see https://github.com/owncloud/android/issues/716)\r
+            if (    Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB && \r
+                    (System.currentTimeMillis() - time) > 24 * 60 * 60 * 1000   ) {\r
+                Date date = new Date(time);\r
+                date.setHours(0);\r
+                date.setMinutes(0);\r
+                date.setSeconds(0);\r
+                dateString = DateUtils.getRelativeDateTimeString(\r
+                        c, date.getTime(), minResolution, transitionResolution, flags\r
+                );\r
+            } else {\r
+                dateString = DateUtils.getRelativeDateTimeString(c, time, minResolution, transitionResolution, flags);\r
+            }\r
+        }\r
+        \r
+        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
+     * Gets the screen size in pixels in a backwards compatible way\r
+     *\r
+     * @param caller        Activity calling; needed to get access to the {@link android.view.WindowManager}\r
+     * @return              Size in pixels of the screen, or default {@link Point} if caller is null\r
+     */\r
+    public static Point getScreenSize(Activity caller) {\r
+        Point size = new Point();\r
+        if (caller != null) {\r
+            Display display = caller.getWindowManager().getDefaultDisplay();\r
+            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {\r
+                display.getSize(size);\r
+            } else {\r
+                size.set(display.getWidth(), display.getHeight());\r
+            }\r
+        }\r
+        return size;\r
+    }\r
+\r