X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/93b6c374005e6a78b355cf788794c834041a6e9a..6def2d6fe8efb00053b750a69610c41ac4581c2e:/src/third_parties/daveKoeller/AlphanumComparator.java?ds=inline diff --git a/src/third_parties/daveKoeller/AlphanumComparator.java b/src/third_parties/daveKoeller/AlphanumComparator.java index e6bd6f38..d0879576 100644 --- a/src/third_parties/daveKoeller/AlphanumComparator.java +++ b/src/third_parties/daveKoeller/AlphanumComparator.java @@ -23,6 +23,7 @@ */ package third_parties.daveKoeller; +import java.io.File; import java.util.Comparator; import com.owncloud.android.datamodel.OCFile; @@ -78,11 +79,21 @@ public class AlphanumComparator implements Comparator return chunk.toString(); } - public int compare(OCFile o1, OCFile o2) - { - String s1 = (String)o1.getRemotePath().toLowerCase(); - String s2 = (String)o2.getRemotePath().toLowerCase(); + public int compare(OCFile o1, OCFile o2){ + String s1 = o1.getRemotePath().toLowerCase(); + String s2 = o2.getRemotePath().toLowerCase(); + + return compare(s1, s2); + } + + public int compare(File f1, File f2){ + String s1 = f1.getPath().toLowerCase(); + String s2 = f2.getPath().toLowerCase(); + + return compare(s1, s2); + } + public int compare(String s1, String s2) { int thisMarker = 0; int thatMarker = 0; int s1Length = s1.length();