@Test public void testListUploadsForDatasetMissingUri() throws Exception { mockDataSetInfo(null, null); assertThat(service.listUploadsForDataset(project, DATASET_ID), Matchers.empty()); }
public Collection<Upload> listUploadsForDataset(Project project, String datasetId) { final UploadsInfo.DataSet dataSet = getDataSetInfo(project, datasetId); if (isEmpty(dataSet.getUploadsUri())) { return emptyList(); } try { final Uploads result = restTemplate.getForObject(dataSet.getUploadsUri(), Uploads.class); if (result == null) { throw new GoodDataException("Empty response from '" + dataSet.getUploadsUri() + "'."); } else if (result.items() == null){ return emptyList(); } return result.items(); } catch (RestClientException e) { throw new GoodDataException("Unable to get '" + dataSet.getUploadsUri() + "'.", e); } }
DatasetService extends AbstractService { public Collection<Upload> listUploadsForDataset(Project project, String datasetId) { final UploadsInfo.DataSet dataSet = getDataSetInfo(project, datasetId); if (isEmpty(dataSet.getUploadsUri())) { return emptyList(); } try { final Uploads result = restTemplate.getForObject(dataSet.getUploadsUri(), Uploads.class); if (result == null) { throw new GoodDataException("Empty response from '" + dataSet.getUploadsUri() + "'."); } else if (result.items() == null){ return emptyList(); } return result.items(); } catch (RestClientException e) { throw new GoodDataException("Unable to get '" + dataSet.getUploadsUri() + "'.", e); } } }
DatasetService extends AbstractService { public Collection<Upload> listUploadsForDataset(Project project, String datasetId) { final UploadsInfo.DataSet dataSet = getDataSetInfo(project, datasetId); if (isEmpty(dataSet.getUploadsUri())) { return emptyList(); } try { final Uploads result = restTemplate.getForObject(dataSet.getUploadsUri(), Uploads.class); if (result == null) { throw new GoodDataException("Empty response from '" + dataSet.getUploadsUri() + "'."); } else if (result.items() == null){ return emptyList(); } return result.items(); } catch (RestClientException e) { throw new GoodDataException("Unable to get '" + dataSet.getUploadsUri() + "'.", e); } } DatasetService(final RestTemplate restTemplate, final DataStoreService dataStoreService,
                          final GoodDataSettings settings); }
DatasetService extends AbstractService { public Collection<Upload> listUploadsForDataset(Project project, String datasetId) { final UploadsInfo.DataSet dataSet = getDataSetInfo(project, datasetId); if (isEmpty(dataSet.getUploadsUri())) { return emptyList(); } try { final Uploads result = restTemplate.getForObject(dataSet.getUploadsUri(), Uploads.class); if (result == null) { throw new GoodDataException("Empty response from '" + dataSet.getUploadsUri() + "'."); } else if (result.items() == null){ return emptyList(); } return result.items(); } catch (RestClientException e) { throw new GoodDataException("Unable to get '" + dataSet.getUploadsUri() + "'.", e); } } DatasetService(final RestTemplate restTemplate, final DataStoreService dataStoreService,
                          final GoodDataSettings settings); DatasetManifest getDatasetManifest(Project project, String datasetId); FutureResult<Void> loadDataset(final Project project, final DatasetManifest manifest,
                                          final InputStream dataset); FutureResult<Void> loadDataset(Project project, String datasetId, InputStream dataset); FutureResult<Void> loadDatasets(final Project project, DatasetManifest... datasets); FutureResult<Void> loadDatasets(final Project project, final Collection<DatasetManifest> datasets); Collection<Link> listDatasetLinks(final Project project); FutureResult<Void> optimizeSliHash(final Project project); FutureResult<Void> updateProjectData(final Project project, final String maqlDml); Collection<Upload> listUploadsForDataset(Project project, String datasetId); Upload getLastUploadForDataset(Project project, String datasetId); UploadStatistics getUploadStatistics(Project project); }
DatasetService extends AbstractService { public Collection<Upload> listUploadsForDataset(Project project, String datasetId) { final UploadsInfo.DataSet dataSet = getDataSetInfo(project, datasetId); if (isEmpty(dataSet.getUploadsUri())) { return emptyList(); } try { final Uploads result = restTemplate.getForObject(dataSet.getUploadsUri(), Uploads.class); if (result == null) { throw new GoodDataException("Empty response from '" + dataSet.getUploadsUri() + "'."); } else if (result.items() == null){ return emptyList(); } return result.items(); } catch (RestClientException e) { throw new GoodDataException("Unable to get '" + dataSet.getUploadsUri() + "'.", e); } } DatasetService(final RestTemplate restTemplate, final DataStoreService dataStoreService,
                          final GoodDataSettings settings); DatasetManifest getDatasetManifest(Project project, String datasetId); FutureResult<Void> loadDataset(final Project project, final DatasetManifest manifest,
                                          final InputStream dataset); FutureResult<Void> loadDataset(Project project, String datasetId, InputStream dataset); FutureResult<Void> loadDatasets(final Project project, DatasetManifest... datasets); FutureResult<Void> loadDatasets(final Project project, final Collection<DatasetManifest> datasets); Collection<Link> listDatasetLinks(final Project project); FutureResult<Void> optimizeSliHash(final Project project); FutureResult<Void> updateProjectData(final Project project, final String maqlDml); Collection<Upload> listUploadsForDataset(Project project, String datasetId); Upload getLastUploadForDataset(Project project, String datasetId); UploadStatistics getUploadStatistics(Project project); static final UriTemplate UPLOADS_INFO_TEMPLATE; }