public class FileInfo extends Object
Note: This class wraps GoogleCloudStorageItemInfo, adds file system specific information and hides bucket/object specific information. The wrapped type should not be visible to callers of GoogleCloudStorageFileSystem because it exposes non-file system information (eg, buckets).
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
boolean |
exists()
Indicates whether this file or directory exists.
|
static FileInfo |
fromItemInfo(GoogleCloudStorageItemInfo itemInfo)
Handy factory method for constructing a FileInfo from a GoogleCloudStorageItemInfo while
potentially returning a singleton instead of really constructing an object for cases like ROOT.
|
static List<FileInfo> |
fromItemInfos(List<GoogleCloudStorageItemInfo> itemInfos)
Handy factory method for constructing a list of FileInfo from a list of
GoogleCloudStorageItemInfo.
|
Map<String,byte[]> |
getAttributes()
Retrieve file attributes for this file.
|
byte[] |
getCrc32cChecksum()
Returns CRC32C checksum of the file or
null. |
long |
getCreationTime()
Gets creation time of this item.
|
byte[] |
getMd5Checksum()
Returns MD5 checksum of the file or
null. |
long |
getModificationTime()
Gets the modification time of this file if one is set, otherwise the value of
getCreationTime() is returned. |
URI |
getPath()
Gets the path of this file or directory.
|
long |
getSize()
Gets the size of this file or directory.
|
int |
hashCode() |
boolean |
isDirectory()
Indicates whether this item 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 this item is an inferred directory.
|
String |
toString()
Gets string representation of this instance.
|
public static final FileInfo ROOT_INFO
public URI getPath()
public boolean isDirectory()
public boolean isInferredDirectory()
public boolean isGlobalRoot()
public long getCreationTime()
Time is expressed as milliseconds since January 1, 1970 UTC.
public long getSize()
For files, size is in number of bytes. For directories size is 0. For items that do not exist, size is -1.
public long getModificationTime()
getCreationTime() is returned.
Time is expressed as milliseconds since January 1, 1970 UTC.
public Map<String,byte[]> getAttributes()
public boolean exists()
public byte[] getCrc32cChecksum()
null.public byte[] getMd5Checksum()
null.public String toString()
public static FileInfo fromItemInfo(GoogleCloudStorageItemInfo itemInfo)
public static List<FileInfo> fromItemInfos(List<GoogleCloudStorageItemInfo> itemInfos)
Copyright © 2023. All rights reserved.