Class DefaultPosixFiles
java.lang.Object
net.rubygrapefruit.platform.internal.AbstractFiles
net.rubygrapefruit.platform.internal.DefaultPosixFiles
- All Implemented Interfaces:
Files
,NativeIntegration
,PosixFiles
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the mode for the given file.Lists the entries of the given directory.Lists the entries of the given directory.Reads the contents of a symbolic link.void
Sets the mode for the given file.Returns basic information about the given file.Returns basic information about the given file.void
Creates a symbolic link with given contents.Methods inherited from class net.rubygrapefruit.platform.internal.AbstractFiles
listDirFailure
-
Constructor Details
-
DefaultPosixFiles
public DefaultPosixFiles()
-
-
Method Details
-
stat
Description copied from interface:PosixFiles
Returns basic information about the given file. Returns whatever file details can be efficiently calculated in a single system call, which is more efficient that querying these details separately.When the file references a symlink, details about the symlink is returned, not the target of the symlink.
- Specified by:
stat
in interfaceFiles
- Specified by:
stat
in interfacePosixFiles
- Parameters:
file
- The path of the file to get details of. Follows symlinks to the parent directory of this file.- Returns:
- Details of the file. Returns details with type
FileInfo.Type.Missing
for a file that does not exist. - Throws:
NativeException
- On failure to query the file information.
-
stat
Description copied from interface:PosixFiles
Returns basic information about the given file. Returns whatever file details can be efficiently calculated in a single system call, which is more efficient that querying these details separately.- Specified by:
stat
in interfaceFiles
- Specified by:
stat
in interfacePosixFiles
- Parameters:
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.- Returns:
- Details of the file. Returns details with type
FileInfo.Type.Missing
for a file that does not exist. - Throws:
NativeException
- On failure to query the file information.
-
listDir
Description copied from interface:Files
Lists the entries of the given directory.When a directory entry is a symlink, details about the symlink is returned, not the target of the symlink.
- Specified by:
listDir
in interfaceFiles
- Parameters:
dir
- The path of the directory to list. Follows symlinks to this directory.- Throws:
NativeException
- On failure.
-
listDir
Description copied from interface:Files
Lists the entries of the given directory.- Specified by:
listDir
in interfaceFiles
- Parameters:
dir
- The path of the directory to list. Follows symlinks to this directory.linkTarget
- When true and a directory entry is a symlink, return details of the target of the symlink instead of details of the symlink itself.- Throws:
NativeException
- On failure.
-
setMode
Description copied from interface:PosixFiles
Sets the mode for the given file.- Specified by:
setMode
in interfacePosixFiles
-
getMode
Description copied from interface:PosixFiles
Gets the mode for the given file.- Specified by:
getMode
in interfacePosixFiles
-
readLink
Description copied from interface:PosixFiles
Reads the contents of a symbolic link.- Specified by:
readLink
in interfacePosixFiles
- Throws:
NativeException
- On failure.
-
symlink
Description copied from interface:PosixFiles
Creates a symbolic link with given contents.- Specified by:
symlink
in interfacePosixFiles
- Throws:
NativeException
- On failure.
-