public class UnixFileSystem
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
UnixFileSystem.FileInformation
Holds Unix-specific information about a file.
|
Constructor and Description |
---|
UnixFileSystem() |
Modifier and Type | Method and Description |
---|---|
static boolean |
createLink(java.lang.String destFileName,
java.io.File linkFile)
Create a symbolic link on Unix.
|
static java.io.File |
findExecutableInPath(java.lang.String executable)
Returns the absolute path of an executable if it is located on the path.
|
static UnixFileSystem.FileInformation |
getFileInformation(java.io.File file)
Get Unix-specific information about a file.
|
static java.lang.String |
getShell()
Returns the shell executable of the current user.
|
static boolean |
setMode(int intMode,
java.io.File destFile)
Set the Unix file mode for a file.
|
static boolean |
setMode(java.lang.String mode,
java.io.File destFile)
Set the Unix file mode for a file.
|
static boolean |
setOwner(java.lang.String owner,
java.io.File file)
Set the owner of a file.
|
public static boolean setMode(int intMode, java.io.File destFile)
intMode
- the Unix file modedestFile
- the file for which the mode should be setpublic static boolean setMode(java.lang.String mode, java.io.File destFile)
mode
- the Unix file mode as an octal string, e.g. "755".destFile
- the file for which the mode should be setpublic static boolean createLink(java.lang.String destFileName, java.io.File linkFile)
destFileName
- the file where the link should point tolinkFile
- the link that should be createdpublic static boolean setOwner(java.lang.String owner, java.io.File file)
owner
- the owner spec. Either a user name like "user" or a user name followed by a colon and a group name, like "user:group".
In tha latter case, "user" can be the empty string and only the group ownership will be changed.file
- the file for which the owner should be set.public static UnixFileSystem.FileInformation getFileInformation(java.io.File file)
file
- the file for which the information is requested.FileInformation
object with the Unix-specific informationpublic static java.io.File findExecutableInPath(java.lang.String executable)
executable
- the executable name without path information or quotesnull
if the executable was not found.public static java.lang.String getShell()
SHELL
environment variable is set, its value is returned, otherwise the return value is
/bin/sh