@InterfaceAudience.Public @InterfaceStability.Stable public class FileStatus extends Object implements Writable, Comparable
Constructor and Description |
---|
FileStatus() |
FileStatus(FileStatus other)
Copy constructor.
|
FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
long access_time,
FsPermission permission,
String owner,
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,
String owner,
String group,
Path symlink,
Path path) |
FileStatus(long length,
boolean isdir,
int block_replication,
long blocksize,
long modification_time,
Path path) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o)
Compare this object to another object
|
boolean |
equals(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.
|
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.
|
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() |
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 |
isFile()
Is this a file?
|
boolean |
isSymlink()
Is this a symbolic link?
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in . |
protected void |
setGroup(String group)
Sets group.
|
protected void |
setOwner(String owner)
Sets owner.
|
void |
setPath(Path p) |
protected void |
setPermission(FsPermission permission)
Sets permission.
|
void |
setSymlink(Path p) |
String |
toString() |
void |
write(DataOutput out)
Serialize the fields of this object to
out . |
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, String owner, String group, Path path)
public FileStatus(long length, boolean isdir, int block_replication, long blocksize, long modification_time, long access_time, FsPermission permission, String owner, String group, Path symlink, Path path)
public FileStatus(FileStatus other) throws IOException
other
- FileStatus to copyIOException
public long getLen()
public boolean isFile()
public boolean isDirectory()
@Deprecated public boolean isDir()
public boolean isSymlink()
public long getBlockSize()
public short getReplication()
public long getModificationTime()
public long getAccessTime()
public FsPermission getPermission()
public boolean isEncrypted()
public String getOwner()
public String getGroup()
protected void setPermission(FsPermission permission)
permission
- if permission is null, default value is setprotected void setOwner(String owner)
owner
- if it is null, default value is setprotected void setGroup(String group)
group
- if it is null, default value is setpublic Path getSymlink() throws IOException
IOException
public void setSymlink(Path p)
public void write(DataOutput out) throws IOException
Writable
out
.write
in interface Writable
out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.IOException
public int compareTo(Object o)
compareTo
in interface Comparable
o
- the object to be compared.ClassCastException
- if the specified object's is not of
type FileStatuspublic int hashCode()
Copyright © 2016 Apache Software Foundation. All rights reserved.