package de.duehl.basics.io.walker;

/*
 * Copyright 2017 Christian Dühl. All rights reserved.
 *
 * This program is free software. You can redistribute it and/or
 * modify it under the same terms as perl:
 *
 * general:  http://dev.perl.org/licenses/
 * GPL:      http://dev.perl.org/licenses/gpl1.html
 * artistic: http://dev.perl.org/licenses/artistic.html
 */

import java.util.Comparator;

public class CaseIgnoringStringComparator implements Comparator<String> {

    @Override
    public int compare(String filename1, String filename2) {
        String lowercaseFilename1 = filename1.toLowerCase();
        String lowercaseFilename2 = filename2.toLowerCase();
        return lowercaseFilename1.compareTo(lowercaseFilename2);
    }

}
