public final class FileSystem extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FileSystem.SystemType
The system type.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
addFolderToPathForJavaSession(File folder)
Add a folder to the path variable for the session, in a few places.
|
static boolean |
addFolderToPathPermanent(File folder)
Add a folder to the permanent path variable.
|
static boolean |
deleteRecursive(File path)
Recursively deletes the path represented by the given file..
|
static File |
findExecutionCommand(String command)
Finds a executable/command from its name.
|
static File |
findExecutionCommand(String command,
Iterable<File> locationHints)
Finds a executable/command from its name, given some location hints.
|
static File |
findFile(String fileName,
File rootDirectory)
Finds a file from its name in the given directories..
|
static File |
findFile(String fileName,
File rootDirectory,
boolean skipSystemLocationCheck,
boolean isDirectory)
Finds a file from its name in the given directories..
|
static FileSystem.SystemType |
getSystemType()
Gets the system type.
|
static boolean |
setEnvironmentVariableForJavaSession(String name,
String value)
Set an environment variable for the session.
|
static boolean |
setEnvironmentVariablePermanent(String name,
String value)
Set an environment variable permanently.
|
public static boolean deleteRecursive(File path) throws FileNotFoundException
path - The path represented by a file.FileNotFoundException - Thrown if the path does not exist.public static File findExecutionCommand(String command)
command - Executable/command name.public static File findExecutionCommand(String command, Iterable<File> locationHints)
command - Executable/command name.locationHints - Hints to the location of the command/executable.public static File findFile(String fileName, File rootDirectory)
fileName - The file name.rootDirectory - The directory in which to look for the file.public static File findFile(String fileName, File rootDirectory, boolean skipSystemLocationCheck, boolean isDirectory)
fileName - The file name.rootDirectory - The directory in which to look for the file.skipSystemLocationCheck - Whether to skip looking in system
locations.isDirectory - Whether the file we are looking for is in fact a
directory.public static boolean addFolderToPathPermanent(File folder)
folder - Folder to add to the path permanently.public static boolean addFolderToPathForJavaSession(File folder)
folder - Folder to add to the path for the session.public static boolean setEnvironmentVariablePermanent(String name, String value)
name - The environment variable name.value - The environment variable value.public static boolean setEnvironmentVariableForJavaSession(String name, String value)
name - The environment variable name.value - The environment variable value.public static FileSystem.SystemType getSystemType()
Copyright © 2016. All rights reserved.