public class GoogleCloudStorageItemInfo extends 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 |
| Modifier and Type | Method and Description |
|---|---|
static GoogleCloudStorageItemInfo |
createBucket(StorageResourceId resourceId,
long creationTime,
long modificationTime,
String location,
String storageClass)
Factory method for creating a GoogleCloudStorageItemInfo for a bucket.
|
static GoogleCloudStorageItemInfo |
createInferredDirectory(StorageResourceId resourceId)
Factory method for creating a "found" GoogleCloudStorageItemInfo for an inferred directory.
|
static GoogleCloudStorageItemInfo |
createNotFound(StorageResourceId resourceId)
Factory method for creating a "not found" GoogleCloudStorageItemInfo for a bucket or an object.
|
static GoogleCloudStorageItemInfo |
createObject(StorageResourceId resourceId,
long creationTime,
long modificationTime,
long size,
String contentType,
String contentEncoding,
Map<String,byte[]> metadata,
long contentGeneration,
long metaGeneration,
VerificationAttributes verificationAttributes)
Factory method for creating a GoogleCloudStorageItemInfo for an object.
|
boolean |
equals(Object obj) |
boolean |
exists()
Indicates whether this item exists.
|
String |
getBucketName()
Gets bucket name of this item.
|
String |
getContentEncoding()
Gets the content-encoding of this item, or null if unknown or inapplicable.
|
long |
getContentGeneration()
Get the content generation of the object.
|
String |
getContentType()
Gets the content-type of this item, or null if unknown or inapplicable.
|
long |
getCreationTime()
Gets creation time of this item.
|
String |
getLocation()
Gets location of this item.
|
Map<String,byte[]> |
getMetadata()
Gets user-supplied metadata for this item.
|
long |
getMetaGeneration()
Get the meta generation of the object.
|
long |
getModificationTime()
Gets modification time of this item.
|
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).
|
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 |
isDirectory()
Indicates whether
itemInfo is a directory. |
boolean |
isGlobalRoot()
Indicates whether this instance has information about the unique, shared root of the underlying
storage system.
|
boolean |
isInferredDirectory()
Indicates whether
itemInfo is an inferred directory |
boolean |
isRoot()
Indicates whether this item refers to the GCS root (gs://).
|
boolean |
metadataEquals(Map<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.
|
String |
toString()
Gets string representation of this instance.
|
public static final GoogleCloudStorageItemInfo ROOT_INFO
public static GoogleCloudStorageItemInfo createBucket(StorageResourceId resourceId, long creationTime, long modificationTime, String location, String storageClass)
resourceId - Resource ID that identifies a bucketcreationTime - Time when a bucket was created (milliseconds since January 1, 1970 UTC).modificationTime - Time when a bucket was last modified (milliseconds since January 1,
1970 UTC).location - Location of a bucket.storageClass - Storage class of a bucket.public static GoogleCloudStorageItemInfo createObject(StorageResourceId resourceId, long creationTime, long modificationTime, long size, String contentType, String contentEncoding, Map<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)
resourceId - Resource ID that identifies an inferred directorypublic static GoogleCloudStorageItemInfo createNotFound(StorageResourceId resourceId)
resourceId - Resource ID that identifies an inferred directorypublic String getBucketName()
public String getObjectName()
public StorageResourceId getResourceId()
public long getCreationTime()
Time is expressed as milliseconds since January 1, 1970 UTC.
public long getModificationTime()
Time is expressed as milliseconds since January 1, 1970 UTC.
public long getSize()
public String getLocation()
Note: Location is only supported for buckets. The value is always null for objects.
public String getStorageClass()
Note: Storage-class is only supported for buckets. The value is always null for objects.
public String getContentType()
Note: content-type is only supported for objects, and will always be null for buckets.
public String getContentEncoding()
Note: content-encoding is only supported for objects, and will always be null for buckets.
public Map<String,byte[]> getMetadata()
Note: metadata is only supported for objects. This value is always an empty map for buckets.
public boolean isBucket()
public boolean isRoot()
public boolean isGlobalRoot()
public boolean isDirectory()
itemInfo is a directory.public boolean isInferredDirectory()
itemInfo is an inferred directorypublic long getContentGeneration()
public long getMetaGeneration()
public VerificationAttributes getVerificationAttributes()
public boolean exists()
public boolean metadataEquals(Map<String,byte[]> otherMetadata)
public String toString()
Copyright © 2024. All rights reserved.