Merge remote-tracking branch 'remotes/upstream/target_marshmallow' into beta
[pub/Android/ownCloud.git] / src / third_parties / daveKoeller / AlphanumComparator.java
index 47cf143..0324493 100644 (file)
@@ -24,6 +24,7 @@
 \r
 package third_parties.daveKoeller;\r
 import java.text.Collator;\r
 \r
 package third_parties.daveKoeller;\r
 import java.text.Collator;\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
@@ -77,9 +78,20 @@ public class AlphanumComparator implements Comparator<OCFile>
     }\r
 \r
     public int compare(OCFile o1, OCFile o2){\r
     }\r
 \r
     public int compare(OCFile o1, OCFile o2){\r
-        String s1 = (String)o1.getRemotePath().toLowerCase();\r
-        String s2 = (String)o2.getRemotePath().toLowerCase();\r
+        String s1 = o1.getRemotePath().toLowerCase();\r
+        String s2 = o2.getRemotePath().toLowerCase();\r
 \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
+    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