@Test public void createDatasetDWCA() throws DatasetRegistryException, URISyntaxException { String meta = "jar:" + getClass().getResource("/org/globalbioticinteractions/dataset/dwca.zip").toURI().toString() + "!/vampire-moth-dwca-c4549a1690b84595c88946f477057b9ab76e5360"; Dataset dataset = datasetFor(meta); assertThat(dataset.getCitation(), is("Occurrence Records for vampire-moths-and-their-fruit-piercing-relatives. 2018-09-27. South Central California Network - 2ba077c1-aa41-455e-9a84-bccb61a91230.")); }
@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);  }