Package org.apache.flink.core.fs.local
Class LocalFileStatus
- java.lang.Object
-
- org.apache.flink.core.fs.local.LocalFileStatus
-
- All Implemented Interfaces:
FileStatus,LocatedFileStatus
@Internal public class LocalFileStatus extends Object implements LocatedFileStatus
The classLocalFileStatusprovides an implementation of theFileStatusinterface for the local file system.
-
-
Constructor Summary
Constructors Constructor Description LocalFileStatus(File f, FileSystem fs)Creates aLocalFileStatusobject from a givenFileobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetAccessTime()Get the access time of the file.BlockLocation[]getBlockLocations()Gets the location information for the file.longgetBlockSize()Get the block size of the file.FilegetFile()longgetLen()Return the length of this file.longgetModificationTime()Get the modification time of the file.PathgetPath()Returns the corresponding Path to the FileStatus.shortgetReplication()Get the replication factor of a file.booleanisDir()Checks if this object represents a directory.StringtoString()
-
-
-
Constructor Detail
-
LocalFileStatus
public LocalFileStatus(File f, FileSystem fs)
Creates aLocalFileStatusobject from a givenFileobject.- Parameters:
f- theFileobject thisLocalFileStatusrefers tofs- the file system the corresponding file has been read from
-
-
Method Detail
-
getAccessTime
public long getAccessTime()
Description copied from interface:FileStatusGet the access time of the file.- Specified by:
getAccessTimein interfaceFileStatus- Returns:
- the access time of file in milliseconds since January 1, 1970 UTC.
-
getBlockSize
public long getBlockSize()
Description copied from interface:FileStatusGet the block size of the file.- Specified by:
getBlockSizein interfaceFileStatus- Returns:
- the number of bytes
-
getLen
public long getLen()
Description copied from interface:FileStatusReturn the length of this file.- Specified by:
getLenin interfaceFileStatus- Returns:
- the length of this file
-
getModificationTime
public long getModificationTime()
Description copied from interface:FileStatusGet the modification time of the file.- Specified by:
getModificationTimein interfaceFileStatus- Returns:
- the modification time of file in milliseconds since January 1, 1970 UTC.
-
getReplication
public short getReplication()
Description copied from interface:FileStatusGet the replication factor of a file.- Specified by:
getReplicationin interfaceFileStatus- Returns:
- the replication factor of a file.
-
isDir
public boolean isDir()
Description copied from interface:FileStatusChecks if this object represents a directory.- Specified by:
isDirin interfaceFileStatus- Returns:
trueif this is a directory,falseotherwise
-
getPath
public Path getPath()
Description copied from interface:FileStatusReturns the corresponding Path to the FileStatus.- Specified by:
getPathin interfaceFileStatus- Returns:
- the corresponding Path to the FileStatus
-
getBlockLocations
public BlockLocation[] getBlockLocations()
Description copied from interface:LocatedFileStatusGets the location information for the file. The location is per block, because each block may live potentially at a different location.Files without location information typically expose one block with no host information for that block.
- Specified by:
getBlockLocationsin interfaceLocatedFileStatus
-
getFile
public File getFile()
-
-