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
VideoCache/src/main/java/com/yc/videocache/file/Md5FileNameGenerator.java