-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
+ * @author David A. Velasco\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
import java.util.HashMap;\r
import java.util.HashSet;\r
import java.util.Set;\r
+import java.util.Vector;\r
\r
import android.annotation.TargetApi;\r
import android.content.Context;\r
\r
/**\r
* A helper class for some string operations.\r
- * \r
- * @author Bartek Przybylski\r
- * @author David A. Velasco\r
*/\r
public class DisplayUtils {\r
\r
\r
\r
private static String getExtension(String filename) {\r
- String extension = filename.substring(filename.lastIndexOf(".") + 1);\r
+ String extension = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();\r
return extension;\r
}\r
\r
/**\r
* Converts Unix time to human readable format\r
- * @param miliseconds that have passed since 01/01/1970\r
+ * @param milliseconds that have passed since 01/01/1970\r
* @return The human readable time for the users locale\r
*/\r
public static String unixTimeToHumanReadable(long milliseconds) {\r
Date date = new Date(milliseconds);\r
DateFormat df = DateFormat.getDateTimeInstance();\r
- //return date.toLocaleString();\r
- return df.format(date); \r
+ return df.format(date);\r
}\r
\r
\r
} else if (url.indexOf("@") != -1) {\r
hostStart = url.indexOf("@") + "@".length();\r
}\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 ? url.length() : hostStart + hostEnd);\r
- \r
+\r
String host = url.substring(hostStart, hostEnd);\r
host = (toASCII ? IDN.toASCII(host) : IDN.toUnicode(host));\r
- \r
+\r
return url.substring(0, hostStart) + host + url.substring(hostEnd);\r
} else {\r
return url;\r
}\r
return path;\r
}\r
+\r
}\r