public class GoogleCloudStorageItemInfo
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
GoogleCloudStorageItemInfo.Provider
Convenience interface for classes which want to implement Provider of
GoogleCloudStorageItemInfo for callers which may not know the concrete type of an object, but
want to check if the object happens to be an instance of this InfoProvider.
|
| Modifier and Type | Field and Description |
|---|---|
static GoogleCloudStorageItemInfo |
ROOT_INFO |
| Constructor and Description |
|---|
GoogleCloudStorageItemInfo(StorageResourceId resourceId,
long creationTime,
long size,
java.lang.String location,
java.lang.String storageClass)
Constructs an instance of GoogleCloudStorageItemInfo.
|
GoogleCloudStorageItemInfo(StorageResourceId resourceId,
long creationTime,
long size,
java.lang.String location,
java.lang.String storageClass,
java.lang.String contentType,
java.lang.String contentEncoding,
java.util.Map<java.lang.String,byte[]> metadata,
long contentGeneration,
long metaGeneration)
Constructs an instance of GoogleCloudStorageItemInfo.
|
GoogleCloudStorageItemInfo(StorageResourceId resourceId,
long creationTime,
long size,
java.lang.String location,
java.lang.String storageClass,
java.lang.String contentType,
java.lang.String contentEncoding,
java.util.Map<java.lang.String,byte[]> metadata,
long contentGeneration,
long metaGeneration,
VerificationAttributes verificationAttributes)
Constructs an instance of GoogleCloudStorageItemInfo.
|
| Modifier and Type | Method and Description |
|---|---|
static GoogleCloudStorageItemInfo |
createInferredDirectory(StorageResourceId resourceId)
Helper for creating a "found" GoogleCloudStorageItemInfo for an inferred directory.
|
static GoogleCloudStorageItemInfo |
createNotFound(StorageResourceId resourceId)
Helper for creating a "not found" GoogleCloudStorageItemInfo for a StorageResourceId.
|
boolean |
equals(java.lang.Object obj) |
boolean |
exists()
Indicates whether this item exists.
|
java.lang.String |
getBucketName()
Gets bucket name of this item.
|
java.lang.String |
getContentEncoding()
Gets the content-encoding of this item, or null if unknown or inapplicable.
|
long |
getContentGeneration()
Get the content generation of the object.
|
java.lang.String |
getContentType()
Gets the content-type of this item, or null if unknown or inapplicable.
|
long |
getCreationTime()
Gets creation time of this item.
|
java.lang.String |
getLocation()
Gets location of this item.
|
java.util.Map<java.lang.String,byte[]> |
getMetadata()
Gets user-supplied metadata for this item.
|
long |
getMetaGeneration()
Get the meta generation of the object.
|
java.lang.String |
getObjectName()
Gets object name of this item.
|
StorageResourceId |
getResourceId()
Gets the resourceId that holds the (possibly null) bucketName and objectName of this object.
|
long |
getSize()
Gets size of this item (number of bytes).
|
java.lang.String |
getStorageClass()
Gets storage class of this item.
|
VerificationAttributes |
getVerificationAttributes()
Get object validation attributes.
|
int |
hashCode() |
boolean |
isBucket()
Indicates whether this item is a bucket.
|
boolean |
isRoot()
Indicates whether this item refers to the GCS root (gs://).
|
boolean |
metadataEquals(java.util.Map<java.lang.String,byte[]> otherMetadata)
Helper for checking logical equality of metadata maps, checking equality of keySet() between
this.metadata and otherMetadata, and then using Arrays.equals to compare contents of
corresponding byte arrays.
|
java.lang.String |
toString()
Gets string representation of this instance.
|
public static final GoogleCloudStorageItemInfo ROOT_INFO
public GoogleCloudStorageItemInfo(StorageResourceId resourceId, long creationTime, long size, java.lang.String location, java.lang.String storageClass)
resourceId - identifies either root, a Bucket, or a StorageObjectcreationTime - Time when object was created (milliseconds since January 1, 1970 UTC).size - Size of the given object (number of bytes) or -1 if the object does not exist.public GoogleCloudStorageItemInfo(StorageResourceId resourceId, long creationTime, long size, java.lang.String location, java.lang.String storageClass, java.lang.String contentType, java.lang.String contentEncoding, java.util.Map<java.lang.String,byte[]> metadata, long contentGeneration, long metaGeneration)
resourceId - identifies either root, a Bucket, or a StorageObjectcreationTime - Time when object was created (milliseconds since January 1, 1970 UTC).size - Size of the given object (number of bytes) or -1 if the object does not exist.metadata - User-supplied object metadata for this object.public GoogleCloudStorageItemInfo(StorageResourceId resourceId, long creationTime, long size, java.lang.String location, java.lang.String storageClass, java.lang.String contentType, java.lang.String contentEncoding, java.util.Map<java.lang.String,byte[]> metadata, long contentGeneration, long metaGeneration, VerificationAttributes verificationAttributes)
resourceId - identifies either root, a Bucket, or a StorageObjectcreationTime - Time when object was created (milliseconds since January 1, 1970 UTC).size - Size of the given object (number of bytes) or -1 if the object does not exist.metadata - User-supplied object metadata for this object.public static GoogleCloudStorageItemInfo createInferredDirectory(StorageResourceId resourceId)
public static GoogleCloudStorageItemInfo createNotFound(StorageResourceId resourceId)
public java.lang.String getBucketName()
public java.lang.String getObjectName()
public StorageResourceId getResourceId()
public long getCreationTime()
public long getSize()
public java.lang.String getLocation()
public java.lang.String getStorageClass()
public java.lang.String getContentType()
public java.lang.String getContentEncoding()
Note: content-encoding is only supported for objects, and will always be null for buckets.
public java.util.Map<java.lang.String,byte[]> getMetadata()
public boolean isBucket()
public boolean isRoot()
public boolean exists()
public long getContentGeneration()
public long getMetaGeneration()
public VerificationAttributes getVerificationAttributes()
public boolean metadataEquals(java.util.Map<java.lang.String,byte[]> otherMetadata)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2019. All rights reserved.