org.apache.hadoop.fs
Class FileStatus

java.lang.Object
  extended by org.apache.hadoop.fs.FileStatus
All Implemented Interfaces:
Writable

public class FileStatus
extends Object
implements Writable

Interface that represents the client side information for a file.


Constructor Summary
FileStatus()
           
FileStatus(long length, boolean isdir, int block_replication, long blocksize, long modification_time, Path path)
           
FileStatus(long length, boolean isdir, short block_replication, long blocksize, long modification_time, Path path)
           
 
Method Summary
 long getBlockSize()
          Get the block size of the file.
 long getLen()
           
 long getModificationTime()
          Get the modification time of the file.
 Path getPath()
           
 short getReplication()
          Get the replication factor of a file.
 boolean isDir()
          Is this a directory?
 void readFields(DataInput in)
          Deserialize the fields of this object from in.
 void write(DataOutput out)
          Serialize the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileStatus

public FileStatus()

FileStatus

public FileStatus(long length,
                  boolean isdir,
                  int block_replication,
                  long blocksize,
                  long modification_time,
                  Path path)

FileStatus

public FileStatus(long length,
                  boolean isdir,
                  short block_replication,
                  long blocksize,
                  long modification_time,
                  Path path)
Method Detail

getLen

public long getLen()

isDir

public boolean isDir()
Is this a directory?

Returns:
true if this is a directory

getBlockSize

public long getBlockSize()
Get the block size of the file.

Returns:
the number of bytes

getReplication

public short getReplication()
Get the replication factor of a file.

Returns:
the replication factor of a file.

getModificationTime

public long getModificationTime()
Get the modification time of the file.

Returns:
the modification time of file in milliseconds since January 1, 1970 UTC.

getPath

public Path getPath()

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
Serialize the fields of this object to out.

Specified by:
write in interface Writable
Parameters:
out - DataOuput to serialize this object into.
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
Deserialize the fields of this object from in.

For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Parameters:
in - DataInput to deseriablize this object from.
Throws:
IOException


Copyright © 2006 The Apache Software Foundation