public class File extends Object
Modifier and Type | Class and Description |
---|---|
static class |
File.Result
File module result object
|
Modifier and Type | Method and Description |
---|---|
static LocalCall<String> |
chmod(String path,
String mode)
Set the mode of a file
|
static LocalCall<String> |
chown(String path,
String user,
String group)
Chown a file
|
static LocalCall<Boolean> |
copy(String src,
String dst,
boolean recurse,
boolean removeExisting)
Copy a file or directory from src to dst
|
static LocalCall<Boolean> |
directoryExists(String path)
Tests to see if path is a valid directory
|
static LocalCall<Boolean> |
fileExists(String path)
Tests to see if path is a valid file
|
static LocalCall<String> |
getHash(String path)
Get the hash sum of a file
|
static LocalCall<String> |
getHash(String path,
HashType form)
Get the hash sum of a file
|
static LocalCall<String> |
getHash(String path,
HashType form,
long chunkSize)
Get the hash sum of a file
|
static LocalCall<String> |
getMode(String path,
boolean followSymlinks)
Return the mode of a file
|
static LocalCall<String> |
mkdir(String path)
Ensures that a directory is available
|
static LocalCall<String> |
mkdir(String path,
String mode)
Ensures that a directory is available
|
static LocalCall<String> |
mkdir(String path,
String user,
String group)
Ensures that a directory is available
|
static LocalCall<String> |
mkdir(String path,
String user,
String group,
String mode)
Ensures that a directory is available
|
static LocalCall<File.Result> |
move(String src,
String dst)
Move a file or directory from src to dst
|
static LocalCall<List<String>> |
readdir(String path)
Returns a list containing the contents of a directory
|
static LocalCall<Boolean> |
remove(String path)
Remove a file
|
static LocalCall<Boolean> |
rmdir(String path)
Removes the specified directory
|
public static LocalCall<String> chown(String path, String user, String group)
path
- Path to the file or directoryuser
- User ownergroup
- Group ownerLocalCall
object to make the callpublic static LocalCall<String> chmod(String path, String mode)
path
- File or directory of which to set the modemode
- Mode to set the path toLocalCall
object to make the callpublic static LocalCall<Boolean> copy(String src, String dst, boolean recurse, boolean removeExisting)
src
- File or directory to copydst
- Destination pathrecurse
- Recurse flagremoveExisting
- If true, all files in the target directory are removed,
and then the files are copied from the sourceLocalCall
object to make the callpublic static LocalCall<File.Result> move(String src, String dst)
src
- File or directory to copydst
- Destination pathLocalCall
object to make the callpublic static LocalCall<Boolean> remove(String path)
path
- File path to removeLocalCall
object to make the callpublic static LocalCall<String> getHash(String path)
SHA256 algorithm is used by default
path
- Path to the file or directoryLocalCall
object to make the callpublic static LocalCall<String> getHash(String path, HashType form)
path
- Path to the file or directoryform
- Desired sum formatLocalCall
object to make the callpublic static LocalCall<String> getHash(String path, HashType form, long chunkSize)
path
- Path to the file or directoryform
- Desired sum formatchunkSize
- Amount to sum at onceLocalCall
object to make the callpublic static LocalCall<Boolean> directoryExists(String path)
path
- Path to directoryLocalCall
object to make the callpublic static LocalCall<Boolean> fileExists(String path)
path
- Path to fileLocalCall
object to make the callpublic static LocalCall<String> getMode(String path, boolean followSymlinks)
path
- File or directory of which to get the modefollowSymlinks
- Indicated if symlinks should be followedLocalCall
object to make the callpublic static LocalCall<String> mkdir(String path)
path
- Path to directoryLocalCall
object to make the callpublic static LocalCall<String> mkdir(String path, String mode)
path
- Path to directorymode
- Mode for the newly created directoryLocalCall
object to make the callpublic static LocalCall<String> mkdir(String path, String user, String group)
path
- Path to directoryuser
- Owner usergroup
- Owner groupLocalCall
object to make the callpublic static LocalCall<String> mkdir(String path, String user, String group, String mode)
path
- Path to directoryuser
- Owner usergroup
- Owner groupmode
- Mode for the newly created directoryLocalCall
object to make the callpublic static LocalCall<List<String>> readdir(String path)
path
- Path to directoryLocalCall
object to make the callCopyright © 2016. All rights reserved.