Class Blob.Builder (2.11.0)

public static class Blob.Builder extends BlobInfo.Builder

Builder for Blob.

Inheritance

java.lang.Object > BlobInfo.Builder > Blob.Builder

Methods

build()

public Blob build()

Creates a BlobInfo object.

Returns
TypeDescription
Blob
Overrides

setAcl(List<Acl> acl)

public Blob.Builder setAcl(List<Acl> acl)

Sets the blob's access control configuration.

Parameter
NameDescription
aclList<Acl>
Returns
TypeDescription
Blob.Builder
Overrides

setBlobId(BlobId blobId)

public Blob.Builder setBlobId(BlobId blobId)

Sets the blob identity.

Parameter
NameDescription
blobIdBlobId
Returns
TypeDescription
Blob.Builder
Overrides

setCacheControl(String cacheControl)

public Blob.Builder setCacheControl(String cacheControl)

Sets the blob's data cache control.

Parameter
NameDescription
cacheControlString
Returns
TypeDescription
Blob.Builder
Overrides

setContentDisposition(String contentDisposition)

public Blob.Builder setContentDisposition(String contentDisposition)

Sets the blob's data content disposition.

Parameter
NameDescription
contentDispositionString
Returns
TypeDescription
Blob.Builder
Overrides

setContentEncoding(String contentEncoding)

public Blob.Builder setContentEncoding(String contentEncoding)

Sets the blob's data content encoding.

Parameter
NameDescription
contentEncodingString
Returns
TypeDescription
Blob.Builder
Overrides

setContentLanguage(String contentLanguage)

public Blob.Builder setContentLanguage(String contentLanguage)

Sets the blob's data content language.

Parameter
NameDescription
contentLanguageString
Returns
TypeDescription
Blob.Builder
Overrides

setContentType(String contentType)

public Blob.Builder setContentType(String contentType)

Sets the blob's data content type.

Parameter
NameDescription
contentTypeString
Returns
TypeDescription
Blob.Builder
Overrides

setCrc32c(String crc32c)

public Blob.Builder setCrc32c(String crc32c)

Sets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; encoded in base64 in big-endian order.

Parameter
NameDescription
crc32cString
Returns
TypeDescription
Blob.Builder
Overrides

setCrc32cFromHexString(String crc32cHexString)

public Blob.Builder setCrc32cFromHexString(String crc32cHexString)

Sets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; from hex string.

Parameter
NameDescription
crc32cHexStringString
Returns
TypeDescription
Blob.Builder
Overrides

setCustomTime(Long customTime)

public Blob.Builder setCustomTime(Long customTime)

Sets the custom time for an object. Once set it can't be unset and only changed to a custom datetime in the future. To unset the custom time, you must either perform a rewrite operation or upload the data again.

Example of setting the custom time.


 String bucketName = "my-unique-bucket";
 String blobName = "my-blob-name";
 long customTime = 1598423868301L;
 BlobInfo blob = BlobInfo.newBuilder(bucketName, blobName).setCustomTime(customTime).build();
 
Parameter
NameDescription
customTimeLong
Returns
TypeDescription
Blob.Builder
Overrides

setEventBasedHold(Boolean eventBasedHold)

public Blob.Builder setEventBasedHold(Boolean eventBasedHold)

Sets the blob's event-based hold.

Parameter
NameDescription
eventBasedHoldBoolean
Returns
TypeDescription
Blob.Builder
Overrides

setMd5(String md5)

public Blob.Builder setMd5(String md5)

Sets the MD5 hash of blob's data. MD5 value must be encoded in base64.

Parameter
NameDescription
md5String
Returns
TypeDescription
Blob.Builder
Overrides

setMd5FromHexString(String md5HexString)

public Blob.Builder setMd5FromHexString(String md5HexString)

Sets the MD5 hash of blob's data from hex string.

Parameter
NameDescription
md5HexStringString
Returns
TypeDescription
Blob.Builder
Overrides

setMetadata(Map<String,String> metadata)

public Blob.Builder setMetadata(Map<String,String> metadata)

Sets the blob's user provided metadata.

Parameter
NameDescription
metadataMap<String,String>
Returns
TypeDescription
Blob.Builder
Overrides

setStorageClass(StorageClass storageClass)

public Blob.Builder setStorageClass(StorageClass storageClass)

Sets the blob's storage class.

Parameter
NameDescription
storageClassStorageClass
Returns
TypeDescription
Blob.Builder
Overrides

setTemporaryHold(Boolean temporaryHold)

public Blob.Builder setTemporaryHold(Boolean temporaryHold)

Sets the blob's temporary hold.

Parameter
NameDescription
temporaryHoldBoolean
Returns
TypeDescription
Blob.Builder
Overrides

setTimeStorageClassUpdated(Long timeStorageClassUpdated)

public Blob.Builder setTimeStorageClassUpdated(Long timeStorageClassUpdated)

Sets the modification time of an object's storage class. Once set it can't be unset directly, the only way is to rewrite the object with the desired storage class.

Parameter
NameDescription
timeStorageClassUpdatedLong
Returns
TypeDescription
Blob.Builder
Overrides