@Test public void createDataset() throws DatasetRegistryException, URISyntaxException { String meta = "jar:" + getClass().getResource("/org/globalbioticinteractions/dataset/archive.zip").toURI().toString() + "!/template-dataset-e68f4487ebc3bc70668c0f738223b92da0598c00/"; Dataset dataset = datasetFor(meta); assertThat(dataset.getCitation(), is("Jorrit H. Poelen. 2014. Species associations manually extracted from literature.")); }
@Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset = registry.datasetFor(namespace); DatasetProxy datasetProxy = new DatasetProxy(dataset); try { Pair<URI, JsonNode> jsonNode = configDataset(dataset); datasetProxy.setConfig(jsonNode.getRight()); datasetProxy.setConfigURI(jsonNode.getLeft()); } catch (Throwable ex) { String msg = "failed to configure dataset in namespace [" + namespace + "]"; throw new DatasetRegistryException(dataset == null ? msg : (msg + " with archiveURI [" + dataset.getArchiveURI() + "] and citation [" + dataset.getCitation() + "]"), ex); } return datasetProxy; }
DatasetFactory implements DatasetFactoryInterface { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset = registry.datasetFor(namespace); DatasetProxy datasetProxy = new DatasetProxy(dataset); try { Pair<URI, JsonNode> jsonNode = configDataset(dataset); datasetProxy.setConfig(jsonNode.getRight()); datasetProxy.setConfigURI(jsonNode.getLeft()); } catch (Throwable ex) { String msg = "failed to configure dataset in namespace [" + namespace + "]"; throw new DatasetRegistryException(dataset == null ? msg : (msg + " with archiveURI [" + dataset.getArchiveURI() + "] and citation [" + dataset.getCitation() + "]"), ex); } return datasetProxy; } }
DatasetFactory implements DatasetFactoryInterface { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset = registry.datasetFor(namespace); DatasetProxy datasetProxy = new DatasetProxy(dataset); try { Pair<URI, JsonNode> jsonNode = configDataset(dataset); datasetProxy.setConfig(jsonNode.getRight()); datasetProxy.setConfigURI(jsonNode.getLeft()); } catch (Throwable ex) { String msg = "failed to configure dataset in namespace [" + namespace + "]"; throw new DatasetRegistryException(dataset == null ? msg : (msg + " with archiveURI [" + dataset.getArchiveURI() + "] and citation [" + dataset.getCitation() + "]"), ex); } return datasetProxy; } DatasetFactory(DatasetRegistry registry);  DatasetFactory(DatasetRegistry registry, InputStreamFactory factory); }
DatasetFactory implements DatasetFactoryInterface { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset = registry.datasetFor(namespace); DatasetProxy datasetProxy = new DatasetProxy(dataset); try { Pair<URI, JsonNode> jsonNode = configDataset(dataset); datasetProxy.setConfig(jsonNode.getRight()); datasetProxy.setConfigURI(jsonNode.getLeft()); } catch (Throwable ex) { String msg = "failed to configure dataset in namespace [" + namespace + "]"; throw new DatasetRegistryException(dataset == null ? msg : (msg + " with archiveURI [" + dataset.getArchiveURI() + "] and citation [" + dataset.getCitation() + "]"), ex); } return datasetProxy; } DatasetFactory(DatasetRegistry registry);  DatasetFactory(DatasetRegistry registry, InputStreamFactory factory); @Override Dataset datasetFor(String namespace); }
DatasetFactory implements DatasetFactoryInterface { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset = registry.datasetFor(namespace); DatasetProxy datasetProxy = new DatasetProxy(dataset); try { Pair<URI, JsonNode> jsonNode = configDataset(dataset); datasetProxy.setConfig(jsonNode.getRight()); datasetProxy.setConfigURI(jsonNode.getLeft()); } catch (Throwable ex) { String msg = "failed to configure dataset in namespace [" + namespace + "]"; throw new DatasetRegistryException(dataset == null ? msg : (msg + " with archiveURI [" + dataset.getArchiveURI() + "] and citation [" + dataset.getCitation() + "]"), ex); } return datasetProxy; } DatasetFactory(DatasetRegistry registry);  DatasetFactory(DatasetRegistry registry, InputStreamFactory factory); @Override Dataset datasetFor(String namespace);  }