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 POSIXHandler
handler
private POSIX
posix
(package private) int
st_blksize
(package private) int
st_ctime
(package private) short
st_mode
(package private) int
st_mtime
(package private) long
st_size
-
Constructor Summary
Constructors Constructor Description JavaFileStat(POSIX posix, POSIXHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
atime()
Limitation: Java has no access time support, so we return mtime as the next best thing.long
blocks()
long
blockSize()
private short
calculateMode(java.io.File file, short st_mode)
private short
calculateSymlink(java.io.File file, short st_mode)
long
ctime()
long
dev()
java.lang.String
ftype()
int
gid()
boolean
groupMember(int gid)
long
ino()
Limitation: We have no pure-java way of getting inode.boolean
isBlockDev()
boolean
isCharDev()
Limitation: [see JRUBY-1516] We just pick more likely value.boolean
isDirectory()
boolean
isEmpty()
boolean
isExecutable()
boolean
isExecutableReal()
boolean
isFifo()
boolean
isFile()
boolean
isGroupOwned()
boolean
isIdentical(FileStat other)
boolean
isNamedPipe()
boolean
isOwned()
boolean
isReadable()
boolean
isReadableReal()
boolean
isROwned()
boolean
isSetgid()
boolean
isSetuid()
boolean
isSocket()
boolean
isSticky()
boolean
isSymlink()
boolean
isWritable()
boolean
isWritableReal()
int
major(long dev)
int
minor(long dev)
int
mode()
long
mtime()
int
nlink()
long
rdev()
void
setup(java.lang.String path)
long
st_size()
Note: Name 'st_size' since Structure has a 'size' method alreadyint
uid()
-
-
-
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:
groupMember
in 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:
isBlockDev
in 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:
isDirectory
in interfaceFileStat
-
isExecutable
public boolean isExecutable()
- Specified by:
isExecutable
in interfaceFileStat
-
isExecutableReal
public boolean isExecutableReal()
- Specified by:
isExecutableReal
in interfaceFileStat
-
isGroupOwned
public boolean isGroupOwned()
- Specified by:
isGroupOwned
in interfaceFileStat
-
isIdentical
public boolean isIdentical(FileStat other)
- Specified by:
isIdentical
in interfaceFileStat
-
isNamedPipe
public boolean isNamedPipe()
- Specified by:
isNamedPipe
in interfaceFileStat
-
isReadable
public boolean isReadable()
- Specified by:
isReadable
in interfaceFileStat
-
isReadableReal
public boolean isReadableReal()
- Specified by:
isReadableReal
in interfaceFileStat
-
isWritable
public boolean isWritable()
- Specified by:
isWritable
in interfaceFileStat
-
isWritableReal
public boolean isWritableReal()
- Specified by:
isWritableReal
in interfaceFileStat
-
st_size
public long st_size()
Description copied from interface:FileStat
Note: Name 'st_size' since Structure has a 'size' method already
-
-