public class GSBlobStorageImpl extends Object implements GSBlobStorage
Constructor and Description |
---|
GSBlobStorageImpl(com.google.cloud.storage.Storage storage)
Constructs a GSBlobStorage instance.
|
Modifier and Type | Method and Description |
---|---|
void |
compose(List<GSBlobIdentifier> sourceBlobIdentifiers,
GSBlobIdentifier targetBlobIdentifier)
Composes multiple blobs into one.
|
void |
copy(GSBlobIdentifier sourceBlobIdentifier,
GSBlobIdentifier targetBlobIdentifier)
Copies from a source blob id to a target blob id.
|
void |
createBlob(GSBlobIdentifier blobIdentifier)
Create an empty blob.
|
List<Boolean> |
delete(Iterable<GSBlobIdentifier> blobIdentifiers)
Deletes blobs.
|
Optional<GSBlobStorage.BlobMetadata> |
getMetadata(GSBlobIdentifier blobIdentifier)
Gets blob metadata.
|
List<GSBlobIdentifier> |
list(String bucketName,
String objectPrefix)
Lists all the blobs in a bucket matching a given prefix.
|
GSBlobStorage.WriteChannel |
writeBlob(GSBlobIdentifier blobIdentifier)
Creates a write channel with the default chunk size.
|
GSBlobStorage.WriteChannel |
writeBlob(GSBlobIdentifier blobIdentifier,
MemorySize chunkSize)
Creates a write channel with the specified chunk size.
|
public GSBlobStorageImpl(com.google.cloud.storage.Storage storage)
storage
- The wrapped Google Storage instance.public GSBlobStorage.WriteChannel writeBlob(GSBlobIdentifier blobIdentifier)
GSBlobStorage
writeBlob
in interface GSBlobStorage
blobIdentifier
- The blob identifier to which to writepublic GSBlobStorage.WriteChannel writeBlob(GSBlobIdentifier blobIdentifier, MemorySize chunkSize)
GSBlobStorage
writeBlob
in interface GSBlobStorage
blobIdentifier
- The blob identifier to which to writechunkSize
- The chunk size, must be > 0public void createBlob(GSBlobIdentifier blobIdentifier)
GSBlobStorage
createBlob
in interface GSBlobStorage
blobIdentifier
- The blob to createpublic Optional<GSBlobStorage.BlobMetadata> getMetadata(GSBlobIdentifier blobIdentifier)
GSBlobStorage
getMetadata
in interface GSBlobStorage
blobIdentifier
- The blob identifierpublic List<GSBlobIdentifier> list(String bucketName, String objectPrefix)
GSBlobStorage
list
in interface GSBlobStorage
bucketName
- The bucket nameobjectPrefix
- The object prefixpublic void copy(GSBlobIdentifier sourceBlobIdentifier, GSBlobIdentifier targetBlobIdentifier)
GSBlobStorage
copy
in interface GSBlobStorage
sourceBlobIdentifier
- The source blob identifiertargetBlobIdentifier
- The target glob identifierpublic void compose(List<GSBlobIdentifier> sourceBlobIdentifiers, GSBlobIdentifier targetBlobIdentifier)
GSBlobStorage
compose
in interface GSBlobStorage
sourceBlobIdentifiers
- The source blob identifiers to combine, max of 32targetBlobIdentifier
- The target blob identifierpublic List<Boolean> delete(Iterable<GSBlobIdentifier> blobIdentifiers)
GSBlobStorage
delete
in interface GSBlobStorage
blobIdentifiers
- The blob identifiers to deleteCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.