public interface BlobContainer
Modifier and Type | Method and Description |
---|---|
boolean |
blobExists(java.lang.String blobName)
Tests whether a blob with the given blob name exists in the container.
|
void |
deleteBlob(java.lang.String blobName)
Deletes a blob with giving name, if the blob exists.
|
java.util.Map<java.lang.String,BlobMetaData> |
listBlobs()
Lists all blobs in the container.
|
java.util.Map<java.lang.String,BlobMetaData> |
listBlobsByPrefix(java.lang.String blobNamePrefix)
Lists all blobs in the container that match the specified prefix.
|
void |
move(java.lang.String sourceBlobName,
java.lang.String targetBlobName)
Renames the source blob into the target blob.
|
BlobPath |
path()
Gets the
BlobPath that defines the implementation specific paths to where the blobs are contained. |
java.io.InputStream |
readBlob(java.lang.String blobName)
Creates a new
InputStream for the given blob name. |
void |
writeBlob(java.lang.String blobName,
java.io.InputStream inputStream,
long blobSize)
Reads blob content from the input stream and writes it to the container in a new blob with the given name.
|
BlobPath path()
BlobPath
that defines the implementation specific paths to where the blobs are contained.boolean blobExists(java.lang.String blobName)
blobName
- The name of the blob whose existence is to be determined.true
if a blob exists in the BlobContainer
with the given name, and false
otherwise.java.io.InputStream readBlob(java.lang.String blobName) throws java.io.IOException
InputStream
for the given blob name.blobName
- The name of the blob to get an InputStream
for.InputStream
to read the blob.java.nio.file.NoSuchFileException
- if the blob does not existjava.io.IOException
- if the blob can not be read.void writeBlob(java.lang.String blobName, java.io.InputStream inputStream, long blobSize) throws java.io.IOException
IOException
will be thrown.blobName
- The name of the blob to write the contents of the input stream to.inputStream
- The input stream from which to retrieve the bytes to write to the blob.blobSize
- The size of the blob to be written, in bytes. It is implementation dependent whether
this value is used in writing the blob to the repository.java.nio.file.FileAlreadyExistsException
- if a blob by the same name already existsjava.io.IOException
- if the input stream could not be read, or the target blob could not be written to.void deleteBlob(java.lang.String blobName) throws java.io.IOException
blobName
- The name of the blob to delete.java.nio.file.NoSuchFileException
- if the blob does not existjava.io.IOException
- if the blob exists but could not be deleted.java.util.Map<java.lang.String,BlobMetaData> listBlobs() throws java.io.IOException
BlobMetaData
, containing basic information about each blob.java.io.IOException
- if there were any failures in reading from the blob container.java.util.Map<java.lang.String,BlobMetaData> listBlobsByPrefix(java.lang.String blobNamePrefix) throws java.io.IOException
blobNamePrefix
- The prefix to match against blob names in the container.BlobMetaData
, containing basic information about each blob.java.io.IOException
- if there were any failures in reading from the blob container.void move(java.lang.String sourceBlobName, java.lang.String targetBlobName) throws java.io.IOException
BlobContainer
for which atomicity can be guaranteed is the
FsBlobContainer
.sourceBlobName
- The blob to rename.targetBlobName
- The name of the blob after the renaming.java.io.IOException
- if the source blob does not exist, the target blob already exists,
or there were any failures in reading from the blob container.