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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract BlobInfobuild()Creates aBlobInfoobject.abstract BlobInfo.BuilderSets the blob's access control configuration.abstract BlobInfo.BuilderSets the blob identity.abstract BlobInfo.BuildersetCacheControl(String cacheControl) Sets the blob's data cache control.abstract BlobInfo.BuildersetContentDisposition(String contentDisposition) Sets the blob's data content disposition.abstract BlobInfo.BuildersetContentEncoding(String contentEncoding) Sets the blob's data content encoding.abstract BlobInfo.BuildersetContentLanguage(String contentLanguage) Sets the blob's data content language.abstract BlobInfo.BuildersetContentType(String contentType) Sets the blob's data content type.abstract BlobInfo.BuilderSets the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; encoded in base64 in big-endian order.abstract BlobInfo.BuildersetCrc32cFromHexString(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.BuildersetEventBasedHold(Boolean eventBasedHold) Sets the blob's event-based hold.abstract BlobInfo.BuilderSets the MD5 hash of blob's data.abstract BlobInfo.BuildersetMd5FromHexString(String md5HexString) Sets the MD5 hash of blob's data from hex string.abstract BlobInfo.BuildersetMetadata(@Nullable Map<@NonNull String, @Nullable String> metadata) Sets the blob's user provided metadata.abstract BlobInfo.BuildersetRetention(BlobInfo.Retention retention) abstract BlobInfo.BuildersetStorageClass(StorageClass storageClass) Sets the blob's storage class.abstract BlobInfo.BuildersetTemporaryHold(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. -
setRetention
-
build
Creates aBlobInfoobject.
-
setCustomTimeOffsetDateTime(OffsetDateTime)