add sort to UploadFileActiviy
[pub/Android/ownCloud.git] / src / third_parties / daveKoeller / AlphanumComparator.java
index e6bd6f3..d087957 100644 (file)
@@ -23,6 +23,7 @@
  */\r
 \r
 package third_parties.daveKoeller;\r
  */\r
 \r
 package third_parties.daveKoeller;\r
+import java.io.File;\r
 import java.util.Comparator;\r
 \r
 import com.owncloud.android.datamodel.OCFile;\r
 import java.util.Comparator;\r
 \r
 import com.owncloud.android.datamodel.OCFile;\r
@@ -78,11 +79,21 @@ public class AlphanumComparator implements Comparator<OCFile>
         return chunk.toString();\r
     }\r
 \r
         return chunk.toString();\r
     }\r
 \r
-    public int compare(OCFile o1, OCFile o2)\r
-    {\r
-        String s1 = (String)o1.getRemotePath().toLowerCase();\r
-        String s2 = (String)o2.getRemotePath().toLowerCase();\r
+    public int compare(OCFile o1, OCFile o2){\r
+        String s1 = o1.getRemotePath().toLowerCase();\r
+        String s2 = o2.getRemotePath().toLowerCase();\r
+\r
+        return compare(s1, s2);\r
+    }\r
+\r
+    public int compare(File f1, File f2){\r
+        String s1 = f1.getPath().toLowerCase();\r
+        String s2 = f2.getPath().toLowerCase();\r
+\r
+        return compare(s1, s2);\r
+    }\r
 \r
 \r
+    public int compare(String s1, String s2) {\r
         int thisMarker = 0;\r
         int thatMarker = 0;\r
         int s1Length = s1.length();\r
         int thisMarker = 0;\r
         int thatMarker = 0;\r
         int s1Length = s1.length();\r