Package jnr.posix
Class JavaFileStat
- java.lang.Object
-
- jnr.posix.JavaFileStat
-
- All Implemented Interfaces:
FileStat
- Direct Known Subclasses:
WindowsRawFileStat
public class JavaFileStat extends java.lang.Object implements FileStat
-
-
Field Summary
Fields Modifier and Type Field Description private POSIXHandlerhandlerprivate POSIXposix(package private) intst_blksize(package private) intst_ctime(package private) shortst_mode(package private) intst_mtime(package private) longst_size
-
Constructor Summary
Constructors Constructor Description JavaFileStat(POSIX posix, POSIXHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longatime()Limitation: Java has no access time support, so we return mtime as the next best thing.longblocks()longblockSize()private shortcalculateMode(java.io.File file, short st_mode)private shortcalculateSymlink(java.io.File file, short st_mode)longctime()longdev()java.lang.Stringftype()intgid()booleangroupMember(int gid)longino()Limitation: We have no pure-java way of getting inode.booleanisBlockDev()booleanisCharDev()Limitation: [see JRUBY-1516] We just pick more likely value.booleanisDirectory()booleanisEmpty()booleanisExecutable()booleanisExecutableReal()booleanisFifo()booleanisFile()booleanisGroupOwned()booleanisIdentical(FileStat other)booleanisNamedPipe()booleanisOwned()booleanisReadable()booleanisReadableReal()booleanisROwned()booleanisSetgid()booleanisSetuid()booleanisSocket()booleanisSticky()booleanisSymlink()booleanisWritable()booleanisWritableReal()intmajor(long dev)intminor(long dev)intmode()longmtime()intnlink()longrdev()voidsetup(java.lang.String path)longst_size()Note: Name 'st_size' since Structure has a 'size' method alreadyintuid()
-
-
-
Field Detail
-
handler
private final POSIXHandler handler
-
posix
private final POSIX posix
-
st_mode
short st_mode
-
st_blksize
int st_blksize
-
st_size
long st_size
-
st_ctime
int st_ctime
-
st_mtime
int st_mtime
-
-
Constructor Detail
-
JavaFileStat
public JavaFileStat(POSIX posix, POSIXHandler handler)
-
-
Method Detail
-
setup
public void setup(java.lang.String path)
-
calculateMode
private short calculateMode(java.io.File file, short st_mode)
-
calculateSymlink
private short calculateSymlink(java.io.File file, short st_mode) throws java.io.IOException- Throws:
java.io.IOException
-
atime
public long atime()
Limitation: Java has no access time support, so we return mtime as the next best thing.
-
groupMember
public boolean groupMember(int gid)
- Specified by:
groupMemberin interfaceFileStat
-
ino
public long ino()
Limitation: We have no pure-java way of getting inode. webrick needs this defined to work.
-
isBlockDev
public boolean isBlockDev()
- Specified by:
isBlockDevin interfaceFileStat
-
isCharDev
public boolean isCharDev()
Limitation: [see JRUBY-1516] We just pick more likely value. This is a little scary.
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectoryin interfaceFileStat
-
isExecutable
public boolean isExecutable()
- Specified by:
isExecutablein interfaceFileStat
-
isExecutableReal
public boolean isExecutableReal()
- Specified by:
isExecutableRealin interfaceFileStat
-
isGroupOwned
public boolean isGroupOwned()
- Specified by:
isGroupOwnedin interfaceFileStat
-
isIdentical
public boolean isIdentical(FileStat other)
- Specified by:
isIdenticalin interfaceFileStat
-
isNamedPipe
public boolean isNamedPipe()
- Specified by:
isNamedPipein interfaceFileStat
-
isReadable
public boolean isReadable()
- Specified by:
isReadablein interfaceFileStat
-
isReadableReal
public boolean isReadableReal()
- Specified by:
isReadableRealin interfaceFileStat
-
isWritable
public boolean isWritable()
- Specified by:
isWritablein interfaceFileStat
-
isWritableReal
public boolean isWritableReal()
- Specified by:
isWritableRealin interfaceFileStat
-
st_size
public long st_size()
Description copied from interface:FileStatNote: Name 'st_size' since Structure has a 'size' method already
-
-