Package com.gooddata.gdc
Class DataStoreService
- java.lang.Object
-
- com.gooddata.gdc.DataStoreService
-
public class DataStoreService extends Object
Uploads, downloads, deletes, ... at datastore
-
-
Constructor Summary
Constructors Constructor Description DataStoreService(org.apache.http.client.HttpClient httpClient, org.springframework.web.client.RestTemplate restTemplate, GdcService gdcService, String gdcUri)Creates new DataStoreService
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String path)Delete given path from datastore.InputStreamdownload(String path)Download given path and return data as streamURIgetUri(String path)Returns uri for given path (which is used by this service for upload, download or delete)voidupload(String path, InputStream stream)Uploads given stream to given datastore path
-
-
-
Constructor Detail
-
DataStoreService
public DataStoreService(org.apache.http.client.HttpClient httpClient, org.springframework.web.client.RestTemplate restTemplate, GdcService gdcService, String gdcUri)Creates new DataStoreService- Parameters:
httpClient- httpClient to make datastore connectionrestTemplate- restTemplate to make datastore connectiongdcService- used to obtain datastore URIgdcUri- complete GDC URI used to prefix possibly relative datastore path
-
-
Method Detail
-
getUri
public URI getUri(String path)
Returns uri for given path (which is used by this service for upload, download or delete)- Parameters:
path- path the uri is constructed for- Returns:
- uri for given path
-
upload
public void upload(String path, InputStream stream)
Uploads given stream to given datastore path- Parameters:
path- path where to upload tostream- stream to upload- Throws:
DataStoreException- in case upload failed
-
download
public InputStream download(String path)
Download given path and return data as stream- Parameters:
path- path from where to download- Returns:
- download stream
- Throws:
DataStoreException- in case download failed
-
delete
public void delete(String path)
Delete given path from datastore.- Parameters:
path- path to delete- Throws:
DataStoreException- in case delete failed
-
-