Files
, NativeIntegration
DefaultPosixFiles
public interface PosixFiles extends Files
Modifier and Type | Method | Description |
---|---|---|
int |
getMode(File path) |
Gets the mode for the given file.
|
String |
readLink(File link) |
Reads the contents of a symbolic link.
|
void |
setMode(File path,
int perms) |
Sets the mode for the given file.
|
PosixFileInfo |
stat(File path) |
Returns basic information about the given file.
|
PosixFileInfo |
stat(File file,
boolean linkTarget) |
Returns basic information about the given file.
|
void |
symlink(File link,
String contents) |
Creates a symbolic link with given contents.
|
void setMode(File path, int perms) throws NativeException
NativeException
- On failure.int getMode(File path) throws NativeException
NativeException
- On failure.void symlink(File link, String contents) throws NativeException
NativeException
- On failure.String readLink(File link) throws NativeException
NativeException
- On failure.PosixFileInfo stat(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(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