Class BlobInfo.Builder (2.36.1)

public abstract static class BlobInfo.Builder

Builder for BlobInfo.

Inheritance

java.lang.Object > BlobInfo.Builder

Constructors

Builder()

public Builder()

Methods

build()

public abstract BlobInfo build()

Creates a BlobInfo object.

Returns
TypeDescription
BlobInfo

setAcl(List<Acl> acl)

public abstract BlobInfo.Builder setAcl(List<Acl> acl)

Sets the blob's access control configuration. See Also: About Access Control Lists

Parameter
NameDescription
aclList<Acl>
Returns
TypeDescription
BlobInfo.Builder

setBlobId(BlobId blobId)

public abstract BlobInfo.Builder setBlobId(BlobId blobId)

Sets the blob identity.

Parameter
NameDescription
blobIdBlobId
Returns
TypeDescription
BlobInfo.Builder

setCacheControl(String cacheControl)

public abstract BlobInfo.Builder setCacheControl(String cacheControl)

Sets the blob's data cache control. See Also: Cache-Control

Parameter
NameDescription
cacheControlString
Returns
TypeDescription
BlobInfo.Builder

setContentDisposition(String contentDisposition)

public abstract BlobInfo.Builder setContentDisposition(String contentDisposition)

Sets the blob's data content disposition. See Also: Content-Disposition

Parameter
NameDescription
contentDispositionString
Returns
TypeDescription
BlobInfo.Builder

setContentEncoding(String contentEncoding)

public abstract BlobInfo.Builder setContentEncoding(String contentEncoding)

Sets the blob's data content encoding. See Also: Content-Encoding

Parameter
NameDescription
contentEncodingString
Returns
TypeDescription
BlobInfo.Builder

setContentLanguage(String contentLanguage)

public abstract BlobInfo.Builder setContentLanguage(String contentLanguage)

Sets the blob's data content language. See Also: Content-Language

Parameter
NameDescription
contentLanguageString
Returns
TypeDescription
BlobInfo.Builder

setContentType(String contentType)

public abstract BlobInfo.Builder setContentType(String contentType)

Sets the blob's data content type. See Also: Content-Type

Parameter
NameDescription
contentTypeString
Returns
TypeDescription
BlobInfo.Builder

setCrc32c(String crc32c)

public abstract BlobInfo.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. See Also: Hashes and ETags: Best Practices

Parameter
NameDescription
crc32cString
Returns
TypeDescription
BlobInfo.Builder

setCrc32cFromHexString(String crc32cHexString)

public abstract BlobInfo.Builder setCrc32cFromHexString(String crc32cHexString)

Sets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; from hex string. See Also: Hashes and ETags: Best Practices

Parameter
NameDescription
crc32cHexStringString
Returns
TypeDescription
BlobInfo.Builder

setCustomTime(Long customTime) (deprecated)

public BlobInfo.Builder setCustomTime(Long customTime)

Deprecated. Use #setCustomTimeOffsetDateTime(OffsetDateTime)

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
BlobInfo.Builder

setCustomTimeOffsetDateTime(OffsetDateTime customTime)

public BlobInfo.Builder setCustomTimeOffsetDateTime(OffsetDateTime 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";
 OffsetDateTime customTime = Instant.ofEpochMilli(1598423868301L).atOffset(0); // UTC
 BlobInfo blob = BlobInfo.newBuilder(bucketName, blobName).setCustomTime(customTime).build();
 
Parameter
NameDescription
customTimeOffsetDateTime
Returns
TypeDescription
BlobInfo.Builder

setEventBasedHold(Boolean eventBasedHold)

public abstract BlobInfo.Builder setEventBasedHold(Boolean eventBasedHold)

Sets the blob's event-based hold.

Parameter
NameDescription
eventBasedHoldBoolean
Returns
TypeDescription
BlobInfo.Builder

setMd5(String md5)

public abstract BlobInfo.Builder setMd5(String md5)

Sets the MD5 hash of blob's data. MD5 value must be encoded in base64. See Also: Hashes and ETags: Best Practices

Parameter
NameDescription
md5String
Returns
TypeDescription
BlobInfo.Builder

setMd5FromHexString(String md5HexString)

public abstract BlobInfo.Builder setMd5FromHexString(String md5HexString)

Sets the MD5 hash of blob's data from hex string. See Also: Hashes and ETags: Best Practices

Parameter
NameDescription
md5HexStringString
Returns
TypeDescription
BlobInfo.Builder

setMetadata(@Nullable Map<@NonNull String,@Nullable String> metadata)

public abstract BlobInfo.Builder setMetadata(@Nullable Map<@NonNull String,@Nullable String> metadata)

Sets the blob's user provided metadata.

Parameter
NameDescription
metadata@org.checkerframework.checker.nullness.qual.Nullable java.util.Map<@org.checkerframework.checker.nullness.qual.NonNull java.lang.String,@org.checkerframework.checker.nullness.qual.Nullable java.lang.String>
Returns
TypeDescription
BlobInfo.Builder

setRetention(BlobInfo.Retention retention)

public abstract BlobInfo.Builder setRetention(BlobInfo.Retention retention)
Parameter
NameDescription
retentionBlobInfo.Retention
Returns
TypeDescription
BlobInfo.Builder

setStorageClass(StorageClass storageClass)

public abstract BlobInfo.Builder setStorageClass(StorageClass storageClass)

Sets the blob's storage class.

Parameter
NameDescription
storageClassStorageClass
Returns
TypeDescription
BlobInfo.Builder

setTemporaryHold(Boolean temporaryHold)

public abstract BlobInfo.Builder setTemporaryHold(Boolean temporaryHold)

Sets the blob's temporary hold.

Parameter
NameDescription
temporaryHoldBoolean
Returns
TypeDescription
BlobInfo.Builder

setTimeStorageClassUpdated(Long timeStorageClassUpdated) (deprecated)

public BlobInfo.Builder setTimeStorageClassUpdated(Long timeStorageClassUpdated)

Deprecated. Use #setTimeStorageClassUpdatedOffsetDateTime(OffsetDateTime)

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
BlobInfo.Builder

setTimeStorageClassUpdatedOffsetDateTime(OffsetDateTime timeStorageClassUpdated)

public BlobInfo.Builder setTimeStorageClassUpdatedOffsetDateTime(OffsetDateTime timeStorageClassUpdated)
Parameter
NameDescription
timeStorageClassUpdatedOffsetDateTime
Returns
TypeDescription
BlobInfo.Builder