public class BlobInfo extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
BlobInfo.Builder
Builder for
BlobInfo . |
static class |
BlobInfo.CustomerEncryption
Objects of this class hold information on the customer-supplied encryption key, if the blob is
encrypted using such a key.
|
static class |
BlobInfo.ImmutableEmptyMap<K,V>
This class is meant for internal use only.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
List<Acl> |
getAcl()
Returns the blob's access control configuration.
|
BlobId |
getBlobId()
Returns the blob's identity.
|
String |
getBucket()
Returns the name of the containing bucket.
|
String |
getCacheControl()
Returns the blob's data cache control.
|
Integer |
getComponentCount()
Returns the number of components that make up this blob.
|
String |
getContentDisposition()
Returns the blob's data content disposition.
|
String |
getContentEncoding()
Returns the blob's data content encoding.
|
String |
getContentLanguage()
Returns the blob's data content language.
|
String |
getContentType()
Returns the blob's data content type.
|
String |
getCrc32c()
Returns the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; encoded in
base64 in big-endian order.
|
String |
getCrc32cToHexString()
Returns the CRC32C checksum of blob's data as described in RFC 4960, Appendix B; decoded to
string.
|
Long |
getCreateTime()
Returns the creation time of the blob.
|
BlobInfo.CustomerEncryption |
getCustomerEncryption()
Returns information on the customer-supplied encryption key, if the blob is encrypted using
such a key.
|
Long |
getDeleteTime()
Returns the deletion time of the blob.
|
String |
getEtag()
Returns HTTP 1.1 Entity tag for the blob.
|
Boolean |
getEventBasedHold()
Returns a
Boolean with either true , null and in certain cases false . |
String |
getGeneratedId()
Returns the service-generated for the blob.
|
Long |
getGeneration()
Returns blob's data generation.
|
String |
getKmsKeyName()
Returns the Cloud KMS key used to encrypt the blob, if any.
|
String |
getMd5()
Returns the MD5 hash of blob's data encoded in base64.
|
String |
getMd5ToHexString()
Returns the MD5 hash of blob's data decoded to string.
|
String |
getMediaLink()
Returns the blob's media download link.
|
Map<String,String> |
getMetadata()
Returns blob's user provided metadata.
|
Long |
getMetageneration()
Returns blob's metageneration.
|
String |
getName()
Returns the blob's name.
|
Acl.Entity |
getOwner()
Returns the blob's owner.
|
Long |
getRetentionExpirationTime()
Returns the retention expiration time of the blob as
Long , if a retention period is
defined. |
String |
getSelfLink()
Returns the URI of this blob as a string.
|
Long |
getSize()
Returns the content length of the data in bytes.
|
StorageClass |
getStorageClass()
Returns the storage class of the blob.
|
Boolean |
getTemporaryHold()
Returns a
Boolean with either true , null and in certain cases false . |
Long |
getUpdateTime()
Returns the last modification time of the blob's metadata.
|
int |
hashCode() |
boolean |
isDirectory()
Returns
true if the current blob represents a directory. |
static BlobInfo.Builder |
newBuilder(BlobId blobId)
Returns a
BlobInfo builder where blob identity is set using the provided value. |
static BlobInfo.Builder |
newBuilder(BucketInfo bucketInfo,
String name)
Returns a
BlobInfo builder where blob identity is set using the provided values. |
static BlobInfo.Builder |
newBuilder(BucketInfo bucketInfo,
String name,
Long generation)
Returns a
BlobInfo builder where blob identity is set using the provided values. |
static BlobInfo.Builder |
newBuilder(String bucket,
String name)
Returns a
BlobInfo builder where blob identity is set using the provided values. |
static BlobInfo.Builder |
newBuilder(String bucket,
String name,
Long generation)
Returns a
BlobInfo builder where blob identity is set using the provided values. |
BlobInfo.Builder |
toBuilder()
Returns a builder for the current blob.
|
String |
toString() |
public BlobId getBlobId()
public String getBucket()
public String getGeneratedId()
public String getName()
public String getCacheControl()
public List<Acl> getAcl()
public Acl.Entity getOwner()
public Long getSize()
public String getContentType()
public String getContentEncoding()
public String getContentDisposition()
public String getContentLanguage()
public Integer getComponentCount()
Storage.compose(Storage.ComposeRequest)
operation and are limited to a count of 1024,
counting 1 for each non-composite component blob and componentCount for each composite
component blob. This value is set only for composite blobs.public String getEtag()
public String getSelfLink()
public String getMd5()
public String getMd5ToHexString()
public String getCrc32c()
public String getCrc32cToHexString()
public String getMediaLink()
public Long getGeneration()
public Long getMetageneration()
public Long getDeleteTime()
public Long getUpdateTime()
public Long getCreateTime()
public boolean isDirectory()
true
if the current blob represents a directory. This can only happen if the
blob is returned by Storage.list(String, Storage.BlobListOption...)
when the Storage.BlobListOption.currentDirectory()
option is used. When this is the case only getBlobId()
and getSize()
are set for the current blob: BlobId.getName()
ends with the '/' character, BlobId.getGeneration()
returns null
and getSize()
is 0
.public BlobInfo.CustomerEncryption getCustomerEncryption()
public StorageClass getStorageClass()
public String getKmsKeyName()
@BetaApi public Boolean getEventBasedHold()
Boolean
with either true
, null
and in certain cases false
.
Case 1: true
the field Storage.BlobField.EVENT_BASED_HOLD
is selected in a Storage.get(BlobId, Storage.BlobGetOption...)
and event-based hold for the blob is enabled.
Case 2.1: null
the field Storage.BlobField.EVENT_BASED_HOLD
is selected in a Storage.get(BlobId, Storage.BlobGetOption...)
, but event-based hold for the blob is not
enabled. This case can be considered implicitly false
.
Case 2.2: null
the field Storage.BlobField.EVENT_BASED_HOLD
is not selected in a Storage.get(BlobId, Storage.BlobGetOption...)
, and the state for this field is unknown.
Case 3: false
event-based hold is explicitly set to false using in a BlobInfo.Builder.setEventBasedHold(Boolean)
client side for a follow-up request e.g. Storage.update(BlobInfo, Storage.BlobTargetOption...)
in which case the value of event-based
hold will remain false
for the given instance.
@BetaApi public Boolean getTemporaryHold()
Boolean
with either true
, null
and in certain cases false
.
Case 1: true
the field Storage.BlobField.TEMPORARY_HOLD
is selected in a Storage.get(BlobId, Storage.BlobGetOption...)
and temporary hold for the blob is enabled.
Case 2.1: null
the field Storage.BlobField.TEMPORARY_HOLD
is selected in a Storage.get(BlobId, Storage.BlobGetOption...)
, but temporary hold for the blob is not enabled.
This case can be considered implicitly false
.
Case 2.2: null
the field Storage.BlobField.TEMPORARY_HOLD
is not selected in a Storage.get(BlobId, Storage.BlobGetOption...)
, and the state for this field is unknown.
Case 3: false
event-based hold is explicitly set to false using in a BlobInfo.Builder.setEventBasedHold(Boolean)
client side for a follow-up request e.g. Storage.update(BlobInfo, Storage.BlobTargetOption...)
in which case the value of temporary
hold will remain false
for the given instance.
@BetaApi public Long getRetentionExpirationTime()
Long
, if a retention period is
defined. If retention period is not defined this value returns null
public BlobInfo.Builder toBuilder()
public static BlobInfo.Builder newBuilder(BucketInfo bucketInfo, String name)
BlobInfo
builder where blob identity is set using the provided values.public static BlobInfo.Builder newBuilder(String bucket, String name)
BlobInfo
builder where blob identity is set using the provided values.public static BlobInfo.Builder newBuilder(BucketInfo bucketInfo, String name, Long generation)
BlobInfo
builder where blob identity is set using the provided values.public static BlobInfo.Builder newBuilder(String bucket, String name, Long generation)
BlobInfo
builder where blob identity is set using the provided values.public static BlobInfo.Builder newBuilder(BlobId blobId)
BlobInfo
builder where blob identity is set using the provided value.Copyright © 2019 Google LLC. All rights reserved.