class FileUtilities {

    public static String getExtension(final String filename) {
        if (filename == null) {
            return null;
        }

        String filenameNormalized = filename.toLowerCase();
        String ext = "";
        int positionOfSlash = filenameNormalized.lastIndexOf('/');

        if (positionOfSlash != -1) {
            filenameNormalized = filenameNormalized.substring(positionOfSlash + 1);
        }

        int positionOfDot = filenameNormalized.lastIndexOf('.');
        if (positionOfDot != -1) {
            ext = filenameNormalized.substring(positionOfDot + 1);
        }

        return ext;
    }

    private  FileUtilities();

}