Class BlobStore
java.lang.Object
ecmwf.ecpds.mover.plugin.http.BlobStore
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionblobMetadata(String containerName, String blobName) Blob metadata.voidclose()Close.booleancontainerExists(String containerName) Container exists.getBlob(String containerName, String blobName, GetOptions options) Gets the blob.getContainerAccess(String containerName) Gets the container access.list()List.list(String containerName, ListContainerOptions options, String prefix, int maxKeys) List.putBlob(String containerName, String blobName, InputStream is) Put blob.voidremoveBlobs(String containerName, Collection<String> blobNames) Removes the blobs.
-
Method Details
-
containerExists
Container exists.- Parameters:
containerName- the container name- Returns:
- true, if successful
-
getContainerAccess
Gets the container access.- Parameters:
containerName- the container name- Returns:
- the container access
-
list
List.- Returns:
- the list
- Throws:
S3Exception- the s 3 exception
-
list
public List<StorageMetadata> list(String containerName, ListContainerOptions options, String prefix, int maxKeys) throws S3Exception List.- Parameters:
containerName- the container nameoptions- the optionsprefix- the prefixmaxKeys- the max keys- Returns:
- the list
- Throws:
S3Exception- the s 3 exception
-
removeBlobs
Removes the blobs.- Parameters:
containerName- the container nameblobNames- the blob names- Throws:
S3Exception- the s 3 exception
-
blobMetadata
Blob metadata.- Parameters:
containerName- the container nameblobName- the blob name- Returns:
- the blob metadata
- Throws:
S3Exception- the s 3 exception
-
getBlob
public Blob getBlob(String containerName, String blobName, GetOptions options) throws S3Exception, IOException Gets the blob.- Parameters:
containerName- the container nameblobName- the blob nameoptions- the options- Returns:
- the blob
- Throws:
S3Exception- the s 3 exceptionIOException- Signals that an I/O exception has occurred.
-
putBlob
public String putBlob(String containerName, String blobName, InputStream is) throws S3Exception, IOException Put blob. Upload data from the given input stream and store it at containerName/blobName. Mirrors the write path used by the REST server (RESTServer.dataFilePost). After the transfer completes a ProxyEvent is recorded so the upload appears in the transfer history, and the ECPDS-assigned ETag is returned.- Parameters:
containerName- the container nameblobName- the blob nameis- the input stream supplying the object data- Returns:
- the ETag string assigned by ECPDS for the stored object
- Throws:
S3Exception- the s 3 exceptionIOException- Signals that an I/O exception has occurred.
-
close
Close.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-