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