Contains a broad set of operations for manipulating files on the file system.
A (potential) blocking and non blocking version of each operation is provided.
The non blocking versions take a handler which is called when the operation completes or an error occurs.
The blocking versions are named xxxBlocking
and return the results, or throw exceptions directly.
In many cases, depending on the operating system and file system some of the potentially blocking operations
can return quickly, which is why we provide them, but it's highly recommended that you test how long they take to
return in your particular application before using them on an event loop.
Please consult the documentation for more information on file system support.
Anything
Object
FileSystem
Basic
Identifiable
Object
Anything
no subtypes hierarchy
Initializer |
FileSystem(FileSystem unknown) |
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
chmod | shared default FileSystem chmod(String path, String perms, Anything(Throwable?) handler) Change the permissions on the file represented by The permission String takes the form rwxr-x— as specified here. Parameters:
|
chmodBlocking | shared default FileSystem chmodBlocking(String path, String perms) Blocking version of #chmod(String, String, Handler) |
chmodRecursive | shared default FileSystem chmodRecursive(String path, String perms, String dirPerms, Anything(Throwable?) handler) Change the permissions on the file represented by The permission String takes the form rwxr-x— as specified in {here}.
If the file is directory then all contents will also have their permissions changed recursively. Any directory permissions will
be set to Parameters:
|
chmodRecursiveBlocking | shared default FileSystem chmodRecursiveBlocking(String path, String perms, String dirPerms) Blocking version of chmodRecursive |
chown | shared default FileSystem chown(String path, String? user, String? group, Anything(Throwable?) handler) Change the ownership on the file represented by Parameters:
|
chownBlocking | shared default FileSystem chownBlocking(String path, String? user, String? group) Blocking version of |
copy | shared default FileSystem copy(String from, String to, Anything(Throwable?) handler) Copy a file from the path The copy will fail if the destination already exists. Parameters:
|
copyBlocking | shared default FileSystem copyBlocking(String from, String to) Blocking version of copy |
copyRecursive | shared default FileSystem copyRecursive(String from, String to, Boolean recursive, Anything(Throwable?) handler) Copy a file from the path
If The copy will fail if the destination if the destination already exists. Parameters:
|
copyRecursiveBlocking | shared default FileSystem copyRecursiveBlocking(String from, String to, Boolean recursive) Blocking version of copyRecursive |
createFile | shared default FileSystem createFile(String path, Anything(Throwable?) handler) Creates an empty file with the specified Parameters:
|
createFile | shared default FileSystem createFile(String path, String perms, Anything(Throwable?) handler) Creates an empty file with the specified Parameters:
|
createFileBlocking | shared default FileSystem createFileBlocking(String path) Blocking version of createFile |
createFileBlocking | shared default FileSystem createFileBlocking(String path, String perms) Blocking version of createFile |
delete | shared default FileSystem delete(String path, Anything(Throwable?) handler) Deletes the file represented by the specified Parameters:
|
deleteBlocking | shared default FileSystem deleteBlocking(String path) Blocking version of delete |
deleteRecursive | shared default FileSystem deleteRecursive(String path, Boolean recursive, Anything(Throwable?) handler) Deletes the file represented by the specified
If the path represents a directory and Parameters:
|
deleteRecursiveBlocking | shared default FileSystem deleteRecursiveBlocking(String path, Boolean recursive) Blocking version of deleteRecursive |
exists | shared default FileSystem exists(String path, Anything(Throwable|Boolean) handler) Determines whether the file as specified by the path Parameters:
|
existsBlocking | shared default Boolean existsBlocking(String path) Blocking version of exists |
fsProps | shared default FileSystem fsProps(String path, Anything(Throwable|FileSystemProps) handler) Returns properties of the file-system being used by the specified Parameters:
|
fsPropsBlocking | shared default FileSystemProps fsPropsBlocking(String path) Blocking version of fsProps |
link | shared default FileSystem link(String link, String existing, Anything(Throwable?) handler) Create a hard link on the file system from Parameters:
|
linkBlocking | shared default FileSystem linkBlocking(String link, String existing) Blocking version of link |
lprops | shared default FileSystem lprops(String path, Anything(Throwable|FileProps) handler) Obtain properties for the link represented by The link will not be followed. Parameters:
|
lpropsBlocking | shared default FileProps lpropsBlocking(String path) Blocking version of lprops |
mkdir | shared default FileSystem mkdir(String path, Anything(Throwable?) handler) Create the directory represented by The operation will fail if the directory already exists. Parameters:
|
mkdir | shared default FileSystem mkdir(String path, String perms, Anything(Throwable?) handler) Create the directory represented by
The new directory will be created with permissions as specified by The permission String takes the form rwxr-x— as specified in here. The operation will fail if the directory already exists. Parameters:
|
mkdirBlocking | shared default FileSystem mkdirBlocking(String path) Blocking version of mkdir |
mkdirBlocking | shared default FileSystem mkdirBlocking(String path, String perms) Blocking version of mkdir |
mkdirs | shared default FileSystem mkdirs(String path, Anything(Throwable?) handler) Create the directory represented by The operation will fail if the directory already exists. Parameters:
|
mkdirs | shared default FileSystem mkdirs(String path, String perms, Anything(Throwable?) handler) Create the directory represented by
The new directory will be created with permissions as specified by The permission String takes the form rwxr-x— as specified in here. The operation will fail if the directory already exists. Parameters:
|
mkdirsBlocking | shared default FileSystem mkdirsBlocking(String path) Blocking version of mkdirs |
mkdirsBlocking | shared default FileSystem mkdirsBlocking(String path, String perms) Blocking version of mkdirs |
move | shared default FileSystem move(String from, String to, Anything(Throwable?) handler) Move a file from the path The move will fail if the destination already exists. Parameters:
|
moveBlocking | shared default FileSystem moveBlocking(String from, String to) Blocking version of move |
open | shared default FileSystem open(String path, OpenOptions options, Anything(Throwable|AsyncFile) handler) Open the file represented by The file is opened for both reading and writing. If the file does not already exist it will be created. Parameters:
|
openBlocking | shared default AsyncFile openBlocking(String path, OpenOptions options) Blocking version of open |
props | shared default FileSystem props(String path, Anything(Throwable|FileProps) handler) Obtain properties for the file represented by If the file is a link, the link will be followed. Parameters:
|
propsBlocking | shared default FileProps propsBlocking(String path) Blocking version of props |
readDir | shared default FileSystem readDir(String path, Anything(Throwable|List<String>) handler) Read the contents of the directory specified by The result is an array of String representing the paths of the files inside the directory. Parameters:
|
readDir | shared default FileSystem readDir(String path, String filter, Anything(Throwable|List<String>) handler) Read the contents of the directory specified by
The parameter The result is an array of String representing the paths of the files inside the directory. Parameters:
|
readDirBlocking | shared default List<String> readDirBlocking(String path) Blocking version of readDir |
readDirBlocking | shared default List<String> readDirBlocking(String path, String filter) Blocking version of readDir |
readFile | shared default FileSystem readFile(String path, Anything(Throwable|Buffer) handler) Reads the entire file as represented by the path Do not user this method to read very large files or you risk running out of available RAM. Parameters:
|
readFileBlocking | shared default Buffer readFileBlocking(String path) Blocking version of readFile |
readSymlink | shared default FileSystem readSymlink(String link, Anything(Throwable|String) handler) Returns the path representing the file that the symbolic link specified by Parameters:
|
readSymlinkBlocking | shared default String readSymlinkBlocking(String link) Blocking version of readSymlink |
symlink | shared default FileSystem symlink(String link, String existing, Anything(Throwable?) handler) Create a symbolic link on the file system from Parameters:
|
symlinkBlocking | shared default FileSystem symlinkBlocking(String link, String existing) Blocking version of link |
truncate | shared default FileSystem truncate(String path, Integer len, Anything(Throwable?) handler) Truncate the file represented by
The operation will fail if the file does not exist or Parameters:
|
truncateBlocking | shared default FileSystem truncateBlocking(String path, Integer len) Blocking version of truncate |
unlink | shared default FileSystem unlink(String link, Anything(Throwable?) handler) Unlinks the link on the file system represented by the path Parameters:
|
unlinkBlocking | shared default FileSystem unlinkBlocking(String link) Blocking version of unlink |
writeFile | shared default FileSystem writeFile(String path, Buffer data, Anything(Throwable?) handler) Creates the file, and writes the specified Parameters:
|
writeFileBlocking | shared default FileSystem writeFileBlocking(String path, Buffer data) Blocking version of writeFile |
Inherited Methods |
Methods inherited from: Object equals |