- java.lang.Object
-
- com.aoapps.io.posix.Stat
-
public class Stat extends Object
One stat call will have all of its output stored in an instance of this class.- Author:
- AO Industries, Inc.
- See Also:
PosixFile.getStat()
-
-
Field Summary
Fields Modifier and Type Field Description static Stat
NOT_EXISTS
A stat that represents a non-existent file.
-
Constructor Summary
Constructors Constructor Description Stat(boolean exists, long device, long inode, long mode, int numberLinks, int uid, int gid, long deviceIdentifier, long size, int blockSize, long blockCount, long accessTime, long modifyTime, long changeTime)
Creates a new stat given all the values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists()
Determines if a file exists, a symbolic link with an invalid destination is still considered to exist.long
getAccessTime()
Gets the last access to this file.long
getBlockCount()
Gets the block count for this file.int
getBlockSize()
Gets the block size for this file.long
getChangeTime()
Gets the change time of this file.long
getDevice()
Gets the device for this file.long
getDeviceIdentifier()
Gets the device identifier for this file.int
getGid()
Gets the group ID for this file.long
getInode()
Gets the inode for this file.long
getMode()
Gets the permission bits of the mode of this file.String
getModeString()
Gets a String representation of the mode of this file similar to the output of the POSIXls
command.long
getModifyTime()
Gets the modification time of the file.int
getNumberLinks()
Gets the link count for this file.long
getRawMode()
Gets the complete mode of the file, including the bits representing the file type.long
getSize()
Gets the size of the file.int
getUid()
Gets the user ID of the file.boolean
isBlockDevice()
Determines if this file represents a block device.boolean
isCharacterDevice()
Determines if this file represents a character device.boolean
isDirectory()
Determines if this file represents a directory.boolean
isFifo()
Determines if this file represents a FIFO.boolean
isRegularFile()
Determines if this file represents a regular file.boolean
isSocket()
Determines if this file represents a socket.boolean
isSymLink()
Determines if this file represents a sybolic link.
-
-
-
Field Detail
-
NOT_EXISTS
public static final Stat NOT_EXISTS
A stat that represents a non-existent file.
-
-
Method Detail
-
exists
public boolean exists()
Determines if a file exists, a symbolic link with an invalid destination is still considered to exist.
-
getDevice
public long getDevice() throws FileNotFoundException
Gets the device for this file.- Throws:
FileNotFoundException
-
getInode
public long getInode() throws FileNotFoundException
Gets the inode for this file.- Throws:
FileNotFoundException
-
getRawMode
public long getRawMode() throws FileNotFoundException
Gets the complete mode of the file, including the bits representing the file type.- Throws:
FileNotFoundException
-
getMode
public long getMode() throws FileNotFoundException
Gets the permission bits of the mode of this file.- Throws:
FileNotFoundException
-
getModeString
public String getModeString() throws FileNotFoundException
Gets a String representation of the mode of this file similar to the output of the POSIXls
command.- Throws:
FileNotFoundException
-
getNumberLinks
public int getNumberLinks() throws FileNotFoundException
Gets the link count for this file.- Throws:
FileNotFoundException
-
getUid
public int getUid() throws FileNotFoundException
Gets the user ID of the file.- Throws:
FileNotFoundException
-
getGid
public int getGid() throws FileNotFoundException
Gets the group ID for this file.- Throws:
FileNotFoundException
-
getDeviceIdentifier
public long getDeviceIdentifier() throws FileNotFoundException
Gets the device identifier for this file.- Throws:
FileNotFoundException
-
getSize
public long getSize() throws FileNotFoundException
Gets the size of the file.- Throws:
FileNotFoundException
-
getBlockSize
public int getBlockSize() throws FileNotFoundException
Gets the block size for this file.- Throws:
FileNotFoundException
-
getBlockCount
public long getBlockCount() throws FileNotFoundException
Gets the block count for this file.- Throws:
FileNotFoundException
-
getAccessTime
public long getAccessTime() throws FileNotFoundException
Gets the last access to this file.- Throws:
FileNotFoundException
-
getModifyTime
public long getModifyTime() throws FileNotFoundException
Gets the modification time of the file.- Throws:
FileNotFoundException
-
getChangeTime
public long getChangeTime() throws FileNotFoundException
Gets the change time of this file.- Throws:
FileNotFoundException
-
isBlockDevice
public boolean isBlockDevice() throws FileNotFoundException
Determines if this file represents a block device.- Throws:
FileNotFoundException
-
isCharacterDevice
public boolean isCharacterDevice() throws FileNotFoundException
Determines if this file represents a character device.- Throws:
FileNotFoundException
-
isDirectory
public boolean isDirectory() throws FileNotFoundException
Determines if this file represents a directory.- Throws:
FileNotFoundException
-
isFifo
public boolean isFifo() throws FileNotFoundException
Determines if this file represents a FIFO.- Throws:
FileNotFoundException
-
isRegularFile
public boolean isRegularFile() throws FileNotFoundException
Determines if this file represents a regular file.- Throws:
FileNotFoundException
-
isSocket
public boolean isSocket() throws FileNotFoundException
Determines if this file represents a socket.- Throws:
FileNotFoundException
-
isSymLink
public boolean isSymLink() throws FileNotFoundException
Determines if this file represents a sybolic link.- Throws:
FileNotFoundException
-
-