public interface PosixFiles extends Files
Modifier and Type | Method and Description |
---|---|
int |
getMode(java.io.File path)
Gets the mode for the given file.
|
java.lang.String |
readLink(java.io.File link)
Reads the contents of a symbolic link.
|
void |
setMode(java.io.File path,
int perms)
Sets the mode for the given file.
|
PosixFileInfo |
stat(java.io.File path)
Returns basic information about the given file.
|
PosixFileInfo |
stat(java.io.File file,
boolean linkTarget)
Returns basic information about the given file.
|
void |
symlink(java.io.File link,
java.lang.String contents)
Creates a symbolic link with given contents.
|
void setMode(java.io.File path, int perms) throws NativeException
NativeException
- On failure.int getMode(java.io.File path) throws NativeException
NativeException
- On failure.void symlink(java.io.File link, java.lang.String contents) throws NativeException
NativeException
- On failure.java.lang.String readLink(java.io.File link) throws NativeException
NativeException
- On failure.PosixFileInfo stat(java.io.File path) throws NativeException
When the file references a symlink, details about the symlink is returned, not the target of the symlink.
stat
in interface Files
path
- The path of the file to get details of. Follows symlinks to the parent directory of this file.FileInfo.Type.Missing
for a file that does not
exist.NativeException
- On failure to query the file information.FilePermissionException
- When the user has insufficient permissions to query the file informationPosixFileInfo stat(java.io.File file, boolean linkTarget) throws NativeException
stat
in interface Files
file
- The path of the file to get details of. Follows symlinks to the parent directory of this file.linkTarget
- When true and the file is a symlink, return details of the target of the symlink instead of details of the symlink itself.FileInfo.Type.Missing
for a file that does not
exist.NativeException
- On failure to query the file information.FilePermissionException
- When the user has insufficient permissions to query the file information