public int compareTo(java.io.File object) {
        File file1 = this;
        File file2 = (File) object;

        Collator collator = Collator.getInstance();

        if (file1.isDirectory() && file2.isFile()) {
            return -1;
        } else if (file1.isFile() && file2.isDirectory()) {
            return +1;
        } else {
            return collator.compare(file1.getName(), file2.getName());
        }
    }