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 aBlobInfoobject.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.BuilderSets the blob identity.- Specified by:
setBlobIdin classBlobInfo.Builder
-
setContentType
Description copied from class:BlobInfo.BuilderSets the blob's data content type.- Specified by:
setContentTypein classBlobInfo.Builder- See Also:
-
setContentDisposition
Description copied from class:BlobInfo.BuilderSets the blob's data content disposition.- Specified by:
setContentDispositionin classBlobInfo.Builder- See Also:
-
setContentLanguage
Description copied from class:BlobInfo.BuilderSets the blob's data content language.- Specified by:
setContentLanguagein classBlobInfo.Builder- See Also:
-
setContentEncoding
Description copied from class:BlobInfo.BuilderSets the blob's data content encoding.- Specified by:
setContentEncodingin classBlobInfo.Builder- See Also:
-
setCacheControl
Description copied from class:BlobInfo.BuilderSets the blob's data cache control.- Specified by:
setCacheControlin classBlobInfo.Builder- See Also:
-
setAcl
Description copied from class:BlobInfo.BuilderSets the blob's access control configuration.- Specified by:
setAclin classBlobInfo.Builder- See Also:
-
setMd5
Description copied from class:BlobInfo.BuilderSets the MD5 hash of blob's data. MD5 value must be encoded in base64.- Specified by:
setMd5in classBlobInfo.Builder- See Also:
-
setMd5FromHexString
Description copied from class:BlobInfo.BuilderSets the MD5 hash of blob's data from hex string.- Specified by:
setMd5FromHexStringin classBlobInfo.Builder- See Also:
-
setCrc32c
Description copied from class:BlobInfo.BuilderSets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; encoded in base64 in big-endian order.- Specified by:
setCrc32cin classBlobInfo.Builder- See Also:
-
setCrc32cFromHexString
Description copied from class:BlobInfo.BuilderSets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; from hex string.- Specified by:
setCrc32cFromHexStringin classBlobInfo.Builder- See Also:
-
setMetadata
Description copied from class:BlobInfo.BuilderSets the blob's user provided metadata.- Specified by:
setMetadatain classBlobInfo.Builder
-
setStorageClass
Description copied from class:BlobInfo.BuilderSets the blob's storage class.- Specified by:
setStorageClassin classBlobInfo.Builder
-
setTimeStorageClassUpdated
Deprecated.Description copied from class:BlobInfo.BuilderSets 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:
setTimeStorageClassUpdatedin classBlobInfo.Builder
-
setTimeStorageClassUpdatedOffsetDateTime
public BlobInfo.Builder setTimeStorageClassUpdatedOffsetDateTime(OffsetDateTime timeStorageClassUpdated) - Overrides:
setTimeStorageClassUpdatedOffsetDateTimein classBlobInfo.Builder
-
setCustomTime
Deprecated.Description copied from class:BlobInfo.BuilderSets 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:
setCustomTimein classBlobInfo.Builder
-
setCustomTimeOffsetDateTime
Description copied from class:BlobInfo.BuilderSets 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:
setCustomTimeOffsetDateTimein classBlobInfo.Builder
-
setEventBasedHold
Description copied from class:BlobInfo.BuilderSets the blob's event-based hold.- Specified by:
setEventBasedHoldin classBlobInfo.Builder
-
setTemporaryHold
Description copied from class:BlobInfo.BuilderSets the blob's temporary hold.- Specified by:
setTemporaryHoldin classBlobInfo.Builder
-
setRetention
- Specified by:
setRetentionin classBlobInfo.Builder
-
build
Description copied from class:BlobInfo.BuilderCreates aBlobInfoobject.- Specified by:
buildin classBlobInfo.Builder
-
setCustomTimeOffsetDateTime(OffsetDateTime)