Package com.google.cloud.storage
Class BlobInfo.Builder
java.lang.Object
com.google.cloud.storage.BlobInfo.Builder
- Direct Known Subclasses:
Blob.Builder
- Enclosing class:
- BlobInfo
Builder for
BlobInfo
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract BlobInfo
build()
Creates aBlobInfo
object.abstract BlobInfo.Builder
Sets the blob's access control configuration.abstract BlobInfo.Builder
Sets the blob identity.abstract BlobInfo.Builder
setCacheControl
(String cacheControl) Sets the blob's data cache control.abstract BlobInfo.Builder
setContentDisposition
(String contentDisposition) Sets the blob's data content disposition.abstract BlobInfo.Builder
setContentEncoding
(String contentEncoding) Sets the blob's data content encoding.abstract BlobInfo.Builder
setContentLanguage
(String contentLanguage) Sets the blob's data content language.abstract BlobInfo.Builder
setContentType
(String contentType) Sets the blob's data content type.abstract BlobInfo.Builder
Sets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; encoded in base64 in big-endian order.abstract BlobInfo.Builder
setCrc32cFromHexString
(String crc32cHexString) Sets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; from hex string.setCustomTime
(Long customTime) Deprecated.setCustomTimeOffsetDateTime
(OffsetDateTime customTime) Sets the custom time for an object.abstract BlobInfo.Builder
setEventBasedHold
(Boolean eventBasedHold) Sets the blob's event-based hold.abstract BlobInfo.Builder
Sets the MD5 hash of blob's data.abstract BlobInfo.Builder
setMd5FromHexString
(String md5HexString) Sets the MD5 hash of blob's data from hex string.abstract BlobInfo.Builder
setMetadata
(@Nullable Map<@NonNull String, @Nullable String> metadata) Sets the blob's user provided metadata.abstract BlobInfo.Builder
setStorageClass
(StorageClass storageClass) Sets the blob's storage class.abstract BlobInfo.Builder
setTemporaryHold
(Boolean temporaryHold) Sets the blob's temporary hold.setTimeStorageClassUpdated
(Long timeStorageClassUpdated) Deprecated.setTimeStorageClassUpdatedOffsetDateTime
(OffsetDateTime timeStorageClassUpdated)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setBlobId
Sets the blob identity. -
setContentType
Sets the blob's data content type.- See Also:
-
setContentDisposition
Sets the blob's data content disposition.- See Also:
-
setContentLanguage
Sets the blob's data content language.- See Also:
-
setContentEncoding
Sets the blob's data content encoding.- See Also:
-
setCacheControl
Sets the blob's data cache control.- See Also:
-
setAcl
Sets the blob's access control configuration.- See Also:
-
setMd5
Sets the MD5 hash of blob's data. MD5 value must be encoded in base64.- See Also:
-
setMd5FromHexString
Sets the MD5 hash of blob's data from hex string.- Throws:
IllegalArgumentException
- when given an invalid hexadecimal value.- See Also:
-
setCrc32c
Sets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; encoded in base64 in big-endian order.- See Also:
-
setCustomTime
Deprecated.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();
-
setCustomTimeOffsetDateTime
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();
-
setCrc32cFromHexString
Sets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; from hex string.- Throws:
IllegalArgumentException
- when given an invalid hexadecimal value.- See Also:
-
setStorageClass
Sets the blob's storage class. -
setTimeStorageClassUpdated
Deprecated.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. -
setTimeStorageClassUpdatedOffsetDateTime
public BlobInfo.Builder setTimeStorageClassUpdatedOffsetDateTime(OffsetDateTime timeStorageClassUpdated) -
setMetadata
public abstract BlobInfo.Builder setMetadata(@Nullable Map<@NonNull String, @Nullable String> metadata) Sets the blob's user provided metadata. -
setEventBasedHold
Sets the blob's event-based hold. -
setTemporaryHold
Sets the blob's temporary hold. -
build
Creates aBlobInfo
object.
-
setCustomTimeOffsetDateTime(OffsetDateTime)