@Test(expected = DatasetRegistryException.class) public void nonExistingDataset() throws DatasetRegistryException, URISyntaxException { createDatasetRegistry().datasetFor("non/existing"); }
@Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset; final URI sourceURI = findLastCachedDatasetURI(namespace); dataset = sourceURI == null ? null : new DatasetFactory(new DatasetRegistry() { @Override public Collection<String> findNamespaces() throws DatasetRegistryException { return Collections.singletonList(namespace); } @Override public Dataset datasetFor(String s) throws DatasetRegistryException { Dataset dataset = new DatasetImpl(namespace, sourceURI, getInputStreamFactory()); return new DatasetWithCache(dataset, cacheFactory.cacheFor(dataset)); } }).datasetFor(namespace); if (dataset == null) { throw new DatasetRegistryException("failed to retrieve/cache dataset in namespace [" + namespace + "]"); } return dataset; }
DatasetRegistryLocal implements DatasetRegistry { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset; final URI sourceURI = findLastCachedDatasetURI(namespace); dataset = sourceURI == null ? null : new DatasetFactory(new DatasetRegistry() { @Override public Collection<String> findNamespaces() throws DatasetRegistryException { return Collections.singletonList(namespace); } @Override public Dataset datasetFor(String s) throws DatasetRegistryException { Dataset dataset = new DatasetImpl(namespace, sourceURI, getInputStreamFactory()); return new DatasetWithCache(dataset, cacheFactory.cacheFor(dataset)); } }).datasetFor(namespace); if (dataset == null) { throw new DatasetRegistryException("failed to retrieve/cache dataset in namespace [" + namespace + "]"); } return dataset; } }
DatasetRegistryLocal implements DatasetRegistry { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset; final URI sourceURI = findLastCachedDatasetURI(namespace); dataset = sourceURI == null ? null : new DatasetFactory(new DatasetRegistry() { @Override public Collection<String> findNamespaces() throws DatasetRegistryException { return Collections.singletonList(namespace); } @Override public Dataset datasetFor(String s) throws DatasetRegistryException { Dataset dataset = new DatasetImpl(namespace, sourceURI, getInputStreamFactory()); return new DatasetWithCache(dataset, cacheFactory.cacheFor(dataset)); } }).datasetFor(namespace); if (dataset == null) { throw new DatasetRegistryException("failed to retrieve/cache dataset in namespace [" + namespace + "]"); } return dataset; } DatasetRegistryLocal(String cacheDir, CacheFactory cacheFactory);  DatasetRegistryLocal(String cacheDir, CacheFactory cacheFactory, InputStreamFactory factory); }
DatasetRegistryLocal implements DatasetRegistry { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset; final URI sourceURI = findLastCachedDatasetURI(namespace); dataset = sourceURI == null ? null : new DatasetFactory(new DatasetRegistry() { @Override public Collection<String> findNamespaces() throws DatasetRegistryException { return Collections.singletonList(namespace); } @Override public Dataset datasetFor(String s) throws DatasetRegistryException { Dataset dataset = new DatasetImpl(namespace, sourceURI, getInputStreamFactory()); return new DatasetWithCache(dataset, cacheFactory.cacheFor(dataset)); } }).datasetFor(namespace); if (dataset == null) { throw new DatasetRegistryException("failed to retrieve/cache dataset in namespace [" + namespace + "]"); } return dataset; } DatasetRegistryLocal(String cacheDir, CacheFactory cacheFactory);  DatasetRegistryLocal(String cacheDir, CacheFactory cacheFactory, InputStreamFactory factory); @Override Collection<String> findNamespaces(); @Override Dataset datasetFor(String namespace); }
DatasetRegistryLocal implements DatasetRegistry { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset; final URI sourceURI = findLastCachedDatasetURI(namespace); dataset = sourceURI == null ? null : new DatasetFactory(new DatasetRegistry() { @Override public Collection<String> findNamespaces() throws DatasetRegistryException { return Collections.singletonList(namespace); } @Override public Dataset datasetFor(String s) throws DatasetRegistryException { Dataset dataset = new DatasetImpl(namespace, sourceURI, getInputStreamFactory()); return new DatasetWithCache(dataset, cacheFactory.cacheFor(dataset)); } }).datasetFor(namespace); if (dataset == null) { throw new DatasetRegistryException("failed to retrieve/cache dataset in namespace [" + namespace + "]"); } return dataset; } DatasetRegistryLocal(String cacheDir, CacheFactory cacheFactory);  DatasetRegistryLocal(String cacheDir, CacheFactory cacheFactory, InputStreamFactory factory); @Override Collection<String> findNamespaces(); @Override Dataset datasetFor(String namespace);  }