@Test public void cache() throws IOException { File cacheDir = CacheUtil.findOrMakeCacheDirForNamespace("target/cache/datasets", "some/namespace"); ContentProvenance contentProvenance = CachePullThrough.cache(URI.create("https: File cachedFile = new File(contentProvenance.getLocalURI()); assertThat(cachedFile.exists(), CoreMatchers.is(true)); assertThat(cachedFile.toURI().toString(), startsWith("file:/")); }
static ContentProvenance cache(URI sourceURI, File cacheDir) throws IOException { return CacheUtil.cache(sourceURI, cacheDir, inStream -> inStream); }
CachePullThrough implements Cache { static ContentProvenance cache(URI sourceURI, File cacheDir) throws IOException { return CacheUtil.cache(sourceURI, cacheDir, inStream -> inStream); } }
CachePullThrough implements Cache { static ContentProvenance cache(URI sourceURI, File cacheDir) throws IOException { return CacheUtil.cache(sourceURI, cacheDir, inStream -> inStream); } CachePullThrough(String namespace, String cachePath);  CachePullThrough(String namespace, String cachePath, InputStreamFactory factory); }
CachePullThrough implements Cache { static ContentProvenance cache(URI sourceURI, File cacheDir) throws IOException { return CacheUtil.cache(sourceURI, cacheDir, inStream -> inStream); } CachePullThrough(String namespace, String cachePath);  CachePullThrough(String namespace, String cachePath, InputStreamFactory factory); @Override ContentProvenance provenanceOf(URI resourceURI); @Override InputStream retrieve(URI resourceURI); }
CachePullThrough implements Cache { static ContentProvenance cache(URI sourceURI, File cacheDir) throws IOException { return CacheUtil.cache(sourceURI, cacheDir, inStream -> inStream); } CachePullThrough(String namespace, String cachePath);  CachePullThrough(String namespace, String cachePath, InputStreamFactory factory); @Override ContentProvenance provenanceOf(URI resourceURI); @Override InputStream retrieve(URI resourceURI);  }