Java Code Examples for com.danikula.videocache.file.FileNameGenerator#generate()

The following examples show how to use com.danikula.videocache.file.FileNameGenerator#generate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpProxyCacheServerTest.java    From AndriodVideoCache with Apache License 2.0 4 votes vote down vote up
private File file(File parent, String url) {
    FileNameGenerator fileNameGenerator = new Md5FileNameGenerator();
    String name = fileNameGenerator.generate(url);
    return new File(parent, name);
}
 
Example 2
Source File: FileNameGeneratorTest.java    From AndriodVideoCache with Apache License 2.0 4 votes vote down vote up
@Test(expected = NullPointerException.class)
public void testAssertNullUrl() throws Exception {
    FileNameGenerator nameGenerator = new Md5FileNameGenerator();
    nameGenerator.generate(null);
    fail("Url should be not null");
}
 
Example 3
Source File: FileNameGeneratorTest.java    From AndriodVideoCache with Apache License 2.0 4 votes vote down vote up
private String generateMd5Name(String rootFolder, String url) {
    FileNameGenerator nameGenerator = new Md5FileNameGenerator();
    String name = nameGenerator.generate(url);
    return new File(rootFolder, name).getAbsolutePath();
}
 
Example 4
Source File: HttpProxyCacheServerTest.java    From AndroidVideoCache with Apache License 2.0 4 votes vote down vote up
private File file(File parent, String url) {
    FileNameGenerator fileNameGenerator = new Md5FileNameGenerator();
    String name = fileNameGenerator.generate(url);
    return new File(parent, name);
}
 
Example 5
Source File: FileNameGeneratorTest.java    From AndroidVideoCache with Apache License 2.0 4 votes vote down vote up
@Test(expected = NullPointerException.class)
public void testAssertNullUrl() throws Exception {
    FileNameGenerator nameGenerator = new Md5FileNameGenerator();
    nameGenerator.generate(null);
    fail("Url should be not null");
}
 
Example 6
Source File: FileNameGeneratorTest.java    From AndroidVideoCache with Apache License 2.0 4 votes vote down vote up
private String generateMd5Name(String rootFolder, String url) {
    FileNameGenerator nameGenerator = new Md5FileNameGenerator();
    String name = nameGenerator.generate(url);
    return new File(rootFolder, name).getAbsolutePath();
}