@Test(expected = NoSuchDataSetException.class) public void test_dwcaGetDataSet01() throws NoSuchDataSetException { client.dwcaGetDataSet("FOO", new DevNullOutputStream()); }
@Override public void dwcaGetDataSet(String name, OutputStream out) throws NoSuchDataSetException { SimpleHttpRequest request = newGetRequest("dwca/getDataSet/" + name); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(NoSuchDataSetException.class)) { throw noSuchDataSetException(exception); } throw exception; } InputStream in = null; try { logger.info("Downloading DarwinCore archive"); in = request.getResponseBodyAsStream(); IOUtil.pipe(in, out, 4096); logger.info("DarwinCore archive download complete"); } finally { IOUtil.close(in); } }
TaxonClient extends NbaClient<Taxon> implements ITaxonAccess { @Override public void dwcaGetDataSet(String name, OutputStream out) throws NoSuchDataSetException { SimpleHttpRequest request = newGetRequest("dwca/getDataSet/" + name); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(NoSuchDataSetException.class)) { throw noSuchDataSetException(exception); } throw exception; } InputStream in = null; try { logger.info("Downloading DarwinCore archive"); in = request.getResponseBodyAsStream(); IOUtil.pipe(in, out, 4096); logger.info("DarwinCore archive download complete"); } finally { IOUtil.close(in); } } }
TaxonClient extends NbaClient<Taxon> implements ITaxonAccess { @Override public void dwcaGetDataSet(String name, OutputStream out) throws NoSuchDataSetException { SimpleHttpRequest request = newGetRequest("dwca/getDataSet/" + name); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(NoSuchDataSetException.class)) { throw noSuchDataSetException(exception); } throw exception; } InputStream in = null; try { logger.info("Downloading DarwinCore archive"); in = request.getResponseBodyAsStream(); IOUtil.pipe(in, out, 4096); logger.info("DarwinCore archive download complete"); } finally { IOUtil.close(in); } } TaxonClient(ClientConfig config, String rootPath); }
TaxonClient extends NbaClient<Taxon> implements ITaxonAccess { @Override public void dwcaGetDataSet(String name, OutputStream out) throws NoSuchDataSetException { SimpleHttpRequest request = newGetRequest("dwca/getDataSet/" + name); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(NoSuchDataSetException.class)) { throw noSuchDataSetException(exception); } throw exception; } InputStream in = null; try { logger.info("Downloading DarwinCore archive"); in = request.getResponseBodyAsStream(); IOUtil.pipe(in, out, 4096); logger.info("DarwinCore archive download complete"); } finally { IOUtil.close(in); } } TaxonClient(ClientConfig config, String rootPath); @Override void downloadQuery(QuerySpec querySpec, OutputStream out); @Override void dwcaQuery(QuerySpec querySpec, OutputStream out); @Override void dwcaGetDataSet(String name, OutputStream out); @Override String[] dwcaGetDataSetNames(); @Override GroupByScientificNameQueryResult groupByScientificName(
      GroupByScientificNameQuerySpec querySpec); }
TaxonClient extends NbaClient<Taxon> implements ITaxonAccess { @Override public void dwcaGetDataSet(String name, OutputStream out) throws NoSuchDataSetException { SimpleHttpRequest request = newGetRequest("dwca/getDataSet/" + name); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(NoSuchDataSetException.class)) { throw noSuchDataSetException(exception); } throw exception; } InputStream in = null; try { logger.info("Downloading DarwinCore archive"); in = request.getResponseBodyAsStream(); IOUtil.pipe(in, out, 4096); logger.info("DarwinCore archive download complete"); } finally { IOUtil.close(in); } } TaxonClient(ClientConfig config, String rootPath); @Override void downloadQuery(QuerySpec querySpec, OutputStream out); @Override void dwcaQuery(QuerySpec querySpec, OutputStream out); @Override void dwcaGetDataSet(String name, OutputStream out); @Override String[] dwcaGetDataSetNames(); @Override GroupByScientificNameQueryResult groupByScientificName(
      GroupByScientificNameQuerySpec querySpec);  }