Class AccessorClient
java.lang.Object
io.clonecloudstore.accessor.apache.client.AccessorClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckBucket
(String bucketName) checkObjectOrDirectory
(String bucketName, String pathDirectoryOrObject) Check if object or directory existvoid
close()
createBucket
(String bucketName) createObject
(AccessorObject accessorObject, InputStream body) createObject
(AccessorObject accessorObject, InputStream body, boolean useCompression) boolean
deleteBucket
(String bucketName) boolean
deleteObject
(String bucketName, String objectName) Note: Compression is only between client and server, result InputStream is uncompressedgetObjectInfo
(String bucketName, String objectName) listObjects
(String bucketName, AccessorFilter filter) Returns an Iterator containing AccessorObjects
-
Constructor Details
-
AccessorClient
-
-
Method Details
-
getBuckets
- Returns:
- the collection of Buckets
- Throws:
CcsWithStatusException
-
checkBucket
- Returns:
- the StorageType for this Bucket
- Throws:
CcsWithStatusException
-
getBucket
- Returns:
- the Bucket Metadata
- Throws:
CcsWithStatusException
-
createBucket
- Returns:
- the DTO if the Bucket is created
- Throws:
CcsWithStatusException
-
deleteBucket
- Returns:
- True if deleted (or already deleted), else False or an exception
- Throws:
CcsWithStatusException
-
checkObjectOrDirectory
public StorageType checkObjectOrDirectory(String bucketName, String pathDirectoryOrObject) throws CcsWithStatusException Check if object or directory exist- Parameters:
pathDirectoryOrObject
- may contain only directory, not full path (as prefix)- Returns:
- the associated StorageType
- Throws:
CcsWithStatusException
-
getObjectInfo
public AccessorObject getObjectInfo(String bucketName, String objectName) throws CcsWithStatusException - Returns:
- the associated DTO
- Throws:
CcsWithStatusException
-
getObject
public InputStreamBusinessOut<AccessorObject> getObject(String bucketName, String objectName) throws CcsWithStatusException - Returns:
- both InputStream and Object DTO
- Throws:
CcsWithStatusException
-
getObject
public InputStreamBusinessOut<AccessorObject> getObject(String bucketName, String objectName, boolean compressed) throws CcsWithStatusException Note: Compression is only between client and server, result InputStream is uncompressed- Returns:
- both InputStream and Object DTO
- Throws:
CcsWithStatusException
-
listObjects
public Iterator<AccessorObject> listObjects(String bucketName, AccessorFilter filter) throws CcsWithStatusException Returns an Iterator containing AccessorObjects- Throws:
CcsWithStatusException
-
createObject
public AccessorObject createObject(AccessorObject accessorObject, InputStream body) throws CcsWithStatusException - Returns:
- the associated DTO
- Throws:
CcsWithStatusException
-
createObject
public AccessorObject createObject(AccessorObject accessorObject, InputStream body, boolean useCompression) throws CcsWithStatusException - Returns:
- the associated DTO
- Throws:
CcsWithStatusException
-
deleteObject
- Returns:
- True if deleted (or already deleted), else False or an exception
- Throws:
CcsWithStatusException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-