private String getExtension(String url) {
        int dotIndex = url.lastIndexOf('.');
        int slashIndex = url.lastIndexOf('/');
        return dotIndex != -1 && dotIndex > slashIndex && dotIndex + 2 + MAX_EXTENSION_LENGTH > url.length() ?
                url.substring(dotIndex + 1, url.length()) : "";
    }
Implementation of {@link FileNameGenerator} that uses MD5 of url as file name

@author Alexey Danilov (danikula@gmail.com).
dkplayer-videocache/src/main/java/com/danikula/videocache/file/Md5FileNameGenerator.java