FileManager implements Serializable { public synchronized File resolve(Key key) { File uriFolder = resolve(key.getURI()); String vary; if (key.getVary().isEmpty()) { vary = "default"; } else { vary = Digester.md5(key.getVary().toString(), StandardCharsets.UTF_8); } return new File(uriFolder, vary); } FileManager(final File baseDirectory); File getBaseDirectory(); synchronized File createFile(Key key, InputStream stream); synchronized File moveFile(File fromFile, Key to); synchronized void clear(); synchronized void remove(Key key); synchronized void clear(URI uri); synchronized void ensureDirectoryExists(File directory); synchronized File resolve(Key key); synchronized File resolve(URI uri);  }
@Test public void verifyResolve() { File file = fileManager.resolve(URI.create("http: assertFalse(file.exists()); assertTrue(file.getAbsolutePath().endsWith("files/57/57b16f3b10b61ed6ce07a15268874bc6")); }