public class DataStoreService extends Object
| Constructor and Description |
|---|
DataStoreService(org.apache.http.client.HttpClient httpClient,
org.springframework.web.client.RestTemplate restTemplate,
GdcService gdcService,
String gdcUri)
Creates new DataStoreService
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(String path)
Delete given path from datastore.
|
InputStream |
download(String path)
Download given path and return data as stream
|
URI |
getUri(String path)
Returns uri for given path (which is used by this service for upload, download or delete)
|
void |
upload(String path,
InputStream stream)
Uploads given stream to given datastore path
|
public DataStoreService(org.apache.http.client.HttpClient httpClient,
org.springframework.web.client.RestTemplate restTemplate,
GdcService gdcService,
String gdcUri)
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 pathpublic URI getUri(String path)
path - path the uri is constructed forpublic void upload(String path, InputStream stream)
path - path where to upload tostream - stream to uploadDataStoreException - in case upload failedpublic InputStream download(String path)
path - path from where to downloadDataStoreException - in case download failedpublic void delete(String path)
path - path to deleteDataStoreException - in case delete failedCopyright © 2017. All Rights Reserved.