java.io.ObjectInputValidation, java.io.Serializable, java.lang.Comparable<java.lang.Object>, WritableLocatedFileStatus@Public @Stable public class FileStatus extends java.lang.Object implements Writable, java.lang.Comparable<java.lang.Object>, java.io.Serializable, java.io.ObjectInputValidation
| Modifier and Type | Class | Description |
|---|---|---|
static class |
FileStatus.AttrFlags |
Flags for entity attributes.
|
| Modifier and Type | Field | Description |
|---|---|---|
static java.util.Set<FileStatus.AttrFlags> |
NONE |
Shared, empty set of attributes (a common case for FileStatus).
|
| Constructor | Description |
|---|---|
FileStatus() |
|
FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
java.lang.String owner,
java.lang.String group,
Path path) |
Constructor for file systems on which symbolic links are not supported
|
FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
java.lang.String owner,
java.lang.String group,
Path symlink,
Path path) |
|
FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
java.lang.String owner,
java.lang.String group,
Path symlink,
Path path,
boolean hasAcl,
boolean isEncrypted,
boolean isErasureCoded) |
|
FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
java.lang.String owner,
java.lang.String group,
Path symlink,
Path path,
java.util.Set<FileStatus.AttrFlags> attr) |
|
FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
Path path) |
|
FileStatus(FileStatus other) |
Copy constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
static java.util.Set<FileStatus.AttrFlags> |
attributes(boolean acl,
boolean crypt,
boolean ec,
boolean sn) |
Convert boolean attributes to a set of flags.
|
int |
compareTo(java.lang.Object o) |
Compare this FileStatus to another FileStatus based on lexicographical
order of path.
|
int |
compareTo(FileStatus o) |
Compare this FileStatus to another FileStatus based on lexicographical
order of path.
|
boolean |
equals(java.lang.Object o) |
Compare if this object is equal to another object
|
long |
getAccessTime() |
Get the access time of the file.
|
long |
getBlockSize() |
Get the block size of the file.
|
java.lang.String |
getGroup() |
Get the group associated with the file.
|
long |
getLen() |
Get the length of this file, in bytes.
|
long |
getModificationTime() |
Get the modification time of the file.
|
java.lang.String |
getOwner() |
Get the owner of the file.
|
Path |
getPath() |
|
FsPermission |
getPermission() |
Get FsPermission associated with the file.
|
short |
getReplication() |
Get the replication factor of a file.
|
Path |
getSymlink() |
|
boolean |
hasAcl() |
Tell whether the underlying file or directory has ACLs set.
|
int |
hashCode() |
Returns a hash code value for the object, which is defined as
the hash code of the path name.
|
boolean |
isDir() |
Deprecated.
|
boolean |
isDirectory() |
Is this a directory?
|
boolean |
isEncrypted() |
Tell whether the underlying file or directory is encrypted or not.
|
boolean |
isErasureCoded() |
Tell whether the underlying file or directory is erasure coded or not.
|
boolean |
isFile() |
Is this a file?
|
boolean |
isSnapshotEnabled() |
Check if directory is Snapshot enabled or not.
|
boolean |
isSymlink() |
Is this a symbolic link?
|
boolean |
isTable() |
Is this a table type
|
void |
readFields(java.io.DataInput in) |
Deprecated.
Use the
PBHelper and protobuf serialization directly. |
protected void |
setGroup(java.lang.String group) |
Sets group.
|
protected void |
setOwner(java.lang.String owner) |
Sets owner.
|
void |
setPath(Path p) |
|
protected void |
setPermission(FsPermission permission) |
Sets permission.
|
void |
setSymlink(Path p) |
|
java.lang.String |
toString() |
|
void |
validateObject() |
|
void |
write(java.io.DataOutput out) |
Deprecated.
Use the
PBHelper and protobuf serialization directly. |
public static final java.util.Set<FileStatus.AttrFlags> NONE
public FileStatus()
public FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
Path path)
public FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
java.lang.String owner,
java.lang.String group,
Path path)
length - length.isdir - isdir.block_replication - block replication.blocksize - block size.modification_time - modification time.access_time - access_time.permission - permission.owner - owner.group - group.path - the path.public FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
java.lang.String owner,
java.lang.String group,
Path symlink,
Path path)
public FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
java.lang.String owner,
java.lang.String group,
Path symlink,
Path path,
boolean hasAcl,
boolean isEncrypted,
boolean isErasureCoded)
public FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
java.lang.String owner,
java.lang.String group,
Path symlink,
Path path,
java.util.Set<FileStatus.AttrFlags> attr)
public FileStatus(FileStatus other) throws java.io.IOException
other - FileStatus to copyjava.io.IOException - raised on errors performing I/O.public static java.util.Set<FileStatus.AttrFlags> attributes(boolean acl, boolean crypt, boolean ec, boolean sn)
acl - See FileStatus.AttrFlags.HAS_ACL.crypt - See FileStatus.AttrFlags.HAS_CRYPT.ec - See FileStatus.AttrFlags.HAS_EC.sn - See FileStatus.AttrFlags.SNAPSHOT_ENABLED.public long getLen()
public boolean isFile()
public boolean isDirectory()
@Deprecated public boolean isDir()
public boolean isTable()
public boolean isSymlink()
public long getBlockSize()
public short getReplication()
public long getModificationTime()
public long getAccessTime()
public FsPermission getPermission()
public boolean hasAcl()
public boolean isEncrypted()
public boolean isErasureCoded()
public boolean isSnapshotEnabled()
public java.lang.String getOwner()
public java.lang.String getGroup()
public Path getPath()
public void setPath(Path p)
protected void setPermission(FsPermission permission)
permission - if permission is null, default value is setprotected void setOwner(java.lang.String owner)
owner - if it is null, default value is setprotected void setGroup(java.lang.String group)
group - if it is null, default value is setpublic Path getSymlink() throws java.io.IOException
java.io.IOException - raised on errors performing I/O.public void setSymlink(Path p)
public int compareTo(FileStatus o)
o - the FileStatus to be compared.public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparable<java.lang.Object>o - the FileStatus to be compared.java.lang.ClassCastException - if the specified object is not FileStatuspublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the object to be compared.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object@Deprecated
public void readFields(java.io.DataInput in)
throws java.io.IOException
PBHelper and protobuf serialization directly.readFields in interface Writablein - Input streamjava.io.IOException - any other problem for readFields.PBHelper.convert(FileStatus)@Deprecated
public void write(java.io.DataOutput out)
throws java.io.IOException
PBHelper and protobuf serialization directly.public void validateObject()
throws java.io.InvalidObjectException
validateObject in interface java.io.ObjectInputValidationjava.io.InvalidObjectExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.