public HistoriesClient getHistoriesClient() { return new HistoriesClientImpl(this); }
@Override public ClientResponse deleteHistoryRequest(String historyId) { return deleteResponse(getWebResource(historyId)); }
public List<HistoryContents> showHistoryContents(String historyId) { return get(getWebResourceContents(historyId), new TypeReference<List<HistoryContents>>() { }); }
public Dataset showDataset(String historyId, String datasetId) { return setGalaxyUrl(getWebResourceContents(historyId).path(datasetId).get(Dataset.class)); }
@Override public CollectionResponse showDatasetCollection(String historyId, String datasetCollectionId) { return getWebResourceContents(historyId).path("dataset_collections"). path(datasetCollectionId).get(CollectionResponse.class); }
public List<History> getHistories() { final TypeReference<List<History>> typeReference = new TypeReference<List<History>>() { }; return get(typeReference); }
@Override public HistoryDeleteResponse deleteHistory(String historyId) { return deleteHistoryRequest(historyId).getEntity(HistoryDeleteResponse.class); } }
public History create(final History history) { return createRequest(history).getEntity(History.class); }
@Override public CollectionResponse createDatasetCollection(String historyId, CollectionDescription collectionDescription) { ClientResponse response = createDatasetCollectionRequest(historyId, collectionDescription); if (response.getStatus() == 200) { return response.getEntity(CollectionResponse.class); } else { throw new RuntimeException("Error creating dataset collection, status=" + response.getStatus() + " returned=" + response.getEntity(String.class)); } }
@Override public void downloadDataset(String historyId, String datasetId, File destinationFile) throws IOException { Dataset dataset = showDataset(historyId, datasetId); String fileExt = dataset.getDataTypeExt(); File downloadedFile = super.getWebResourceContents(historyId) .path(datasetId).path("display").queryParam("to_ext", fileExt) .get(File.class); downloadedFile.renameTo(destinationFile); FileWriter fr = new FileWriter(downloadedFile); fr.close(); }
public HistoryContentsProvenance showProvenance(String historyId, String datasetId) { return getWebResourceContents(historyId).path(datasetId).path("provenance").get(HistoryContentsProvenance.class); }