public class StorageClient extends Object
| Constructor and Description |
|---|
StorageClient(String storageUser,
String storagePass)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
createContainer(String containerName)
Creates a container named as given
containerName. |
boolean |
deleteContainer(String containerName)
Deletes a container.
|
boolean |
deleteObject(String containerName,
String objectName)
Deletes an object.
|
Integer |
getConnectTimeout()
Returns connect timeout.
|
Map<String,List<String>> |
getHeaderFields()
Returns last HTTP response header fields.
|
Integer |
getReadTimeout()
Return read timeout.
|
int |
getResponseCode()
Returns last HTTP response status code.
|
String |
getResponseMessage()
Returns last HTTP response reason phrase.
|
boolean |
readObject(String containerName,
String objectName,
ContentConsumer contentConsumer)
Reads object content.
|
boolean |
readObject(String containerName,
String objectName,
ContentDataConsumer contentDataConsumer)
Reads object content.
|
boolean |
readObject(String containerName,
String objectName,
OutputStream contentDataOutput)
Reads an object's content.
|
boolean |
readStorageContainer(String containerName,
StorageContainer storageContainer) |
boolean |
readStorageContainers(Map<String,Object> queryParameters,
Collection<StorageContainer> storageContainers)
Reads information of containers.
|
boolean |
readStorageObject(String containerName,
String objectName,
StorageObject storageObject) |
boolean |
readStorageObjects(String containerName,
Map<String,Object> queryParameters,
Collection<StorageObject> storageObjects)
Reads objects information of a container.
|
void |
setConnectTimeout(Integer connectTimeout)
Sets connect timeout.
|
void |
setReadTimeout(Integer readTimeout)
Sets read timeout.
|
boolean |
updateObject(String containerName,
String objectName,
ContentProducer contentProducer)
Updates an object's content.
|
boolean |
updateObject(String containerName,
String objectName,
String contentType,
byte[] contentData)
Updates an object's content.
|
boolean |
updateObject(String containerName,
String objectName,
String contentType,
long contentLength,
ContentDataProducer contentDataProducer)
Updates an object's content.
|
boolean |
updateObject(String containerName,
String objectName,
String contentType,
long contentLength,
InputStream contentData)
Updates an object's content.
|
public boolean readStorageContainer(String containerName, StorageContainer storageContainer) throws IOException
containerName - container namestorageContainer - storage containerIOException - if an I/O error occurspublic boolean readStorageContainers(Map<String,Object> queryParameters, Collection<StorageContainer> storageContainers) throws IOException
queryParameters - query parameters; null is allowedstorageContainers - the collecion to which results are addedIOException - if an I/O error occurs.public boolean createContainer(String containerName) throws IOException
containerName.containerName - container nameIOException - if an I/O error occurs.public boolean deleteContainer(String containerName) throws IOException
containerName - container nameIOException - if an I/O error occurs.public boolean readStorageObject(String containerName, String objectName, StorageObject storageObject) throws IOException
containerName - objectName - storageObject - IOExceptionpublic boolean readStorageObjects(String containerName, Map<String,Object> queryParameters, Collection<StorageObject> storageObjects) throws IOException
containerName - container namequeryParameters - query parameters; null is allowedstorageObjects - the collection to which all results are addedIOException - if an I/O error occurspublic boolean updateObject(String containerName, String objectName, String contentType, byte[] contentData) throws IOException
containerName - container nameobjectName - object namecontentType - content type; null for unknowncontentData - content dataIOException - if an I/O error occurspublic boolean updateObject(String containerName, String objectName, String contentType, long contentLength, InputStream contentData) throws IOException
containerName - container nameobjectName - object namecontentType - content type; null for unknowncontentLength - content length; -1L for unknowncontentData - content dataIOException - if an I/O error occurspublic boolean updateObject(String containerName, String objectName, String contentType, long contentLength, ContentDataProducer contentDataProducer) throws IOException
containerName - container nameobjectName - object namecontentType - content type; null for unknowncontentLength - content length; -1L for unknowncontentDataProducer - content data producerIOException - if an I/O error occurs.public boolean updateObject(String containerName, String objectName, ContentProducer contentProducer) throws IOException
containerName - container nameobjectName - object namecontentProducer - content producerIOException - if an I/O error occurspublic boolean readObject(String containerName, String objectName, OutputStream contentDataOutput) throws IOException
containerName - container nameobjectName - object namecontentDataOutput - the output stream to which content is writtenIOException - if an I/O error occurspublic boolean readObject(String containerName, String objectName, ContentDataConsumer contentDataConsumer) throws IOException
containerName - container nameobjectName - object namecontentDataConsumer - content data consumerIOException - if an I/O error occurs.public boolean readObject(String containerName, String objectName, ContentConsumer contentConsumer) throws IOException
containerName - container nameobjectName - object namecontentConsumer - content consumerIOException - if an I/O error occurspublic boolean deleteObject(String containerName, String objectName) throws IOException
containerName - container nameobjectName - object nameIOException - if an I/O error occurs.public Integer getConnectTimeout()
public void setConnectTimeout(Integer connectTimeout)
connectTimeout - connect timeoutpublic Integer getReadTimeout()
public void setReadTimeout(Integer readTimeout)
readTimeout - read timeoutpublic int getResponseCode()
public String getResponseMessage()
Copyright © 2011-2012. All Rights Reserved.