X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/7579d3daf7dd2135877b1029d0576fa2cb60aaaa..af2841eea2eb1240e6b6b95eab797d0cc24fcaa5:/src/third_parties/daveKoeller/AlphanumComparator.java diff --git a/src/third_parties/daveKoeller/AlphanumComparator.java b/src/third_parties/daveKoeller/AlphanumComparator.java index 47cf1437..03244930 100644 --- a/src/third_parties/daveKoeller/AlphanumComparator.java +++ b/src/third_parties/daveKoeller/AlphanumComparator.java @@ -24,6 +24,7 @@ package third_parties.daveKoeller; import java.text.Collator; +import java.io.File; import java.util.Comparator; import com.owncloud.android.datamodel.OCFile; @@ -77,9 +78,20 @@ public class AlphanumComparator implements Comparator } public int compare(OCFile o1, OCFile o2){ - String s1 = (String)o1.getRemotePath().toLowerCase(); - String s2 = (String)o2.getRemotePath().toLowerCase(); + 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();