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.
| Modifier and Type | Method and Description |
|---|---|
| public FileSystem | |
| public Future | chmod(String path, String perms)
Like |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to the file path, String the permissions string perms, String the directory permissions dirPerms, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Change the permissions on the file represented by |
| public Future | chmodRecursive(String path, String perms, String dirPerms)
Like |
| public FileSystem | chmodRecursiveBlocking(String path, String perms, String dirPerms)
Blocking version of |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to the file path, @Nullable String the user name, user, @Nullable String null will not change the user namethe user group, group, Handler<AsyncResult<Void>> null will not change the user group namethe handler that will be called on completion handler)Change the ownership on the file represented by |
| public Future | |
| public FileSystem | chownBlocking(String path, @Nullable String user, @Nullable String group)
Blocking version of |
| public FileSystem | |
| public Future | copy(String from, String to)
Like |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to copy from from, String the path to copy to to, CopyOptions options describing how the file should be copied options, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Copy a file from the path |
| public Future | copy(String from, String to, CopyOptions options)
Like |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to copy from from, String the path to copy to to, boolean recursive, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Copy a file from the path |
| public Future | copyRecursive(String from, String to, boolean recursive)
Like |
| public FileSystem | copyRecursiveBlocking(String from, String to, boolean recursive)
Blocking version of |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Creates an empty file with the specified |
| public Future | createFile(String path)
Like |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, String the permissions string perms, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Creates an empty file with the specified |
| public Future | createFile(String path, String perms)
Like |
| public FileSystem | |
| public FileSystem | createFileBlocking(String path, String perms)
Blocking version of |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe prefix string to be used in generating the directory's name;
may be prefix, Handler<AsyncResult<String>> nullthe handler that will be called on completion handler)Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously. |
| public Future | createTempDirectory(String prefix)
Like |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe prefix string to be used in generating the directory's name;
may be prefix, String nullthe permissions string perms, Handler<AsyncResult<String>> the handler that will be called on completion handler)Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously. |
| public Future | createTempDirectory(String prefix, String perms)
Like |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to directory in which to create the directory dir, String the prefix string to be used in generating the directory's name;
may be prefix, String nullthe permissions string perms, Handler<AsyncResult<String>> the handler that will be called on completion handler)Creates a new directory in the directory provided by the path |
| public Future | createTempDirectory(String dir, String prefix, String perms)
Like |
| public String | |
| public String | createTempDirectoryBlocking(String prefix, String perms)
Blocking version of |
| public String | createTempDirectoryBlocking(String dir, String prefix, String perms)
Blocking version of |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe prefix string to be used in generating the directory's name;
may be prefix, String nullthe suffix string to be used in generating the file's name;
may be suffix, Handler<AsyncResult<String>> null, in which case ".tmp" is usedthe handler that will be called on completion handler)Creates a new file in the default temporary-file directory, using the given prefix and suffix to generate its name, asynchronously. |
| public Future | createTempFile(String prefix, String suffix)
Like |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe prefix string to be used in generating the directory's name;
may be prefix, String nullthe suffix string to be used in generating the file's name;
may be suffix, String perms, Handler<AsyncResult<String>> null, in which case ".tmp" is usedthe handler that will be called on completion handler)Creates a new file in the directory provided by the path |
| public Future | createTempFile(String prefix, String suffix, String perms)
Like |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to directory in which to create the directory dir, String the prefix string to be used in generating the directory's name;
may be prefix, String nullthe suffix string to be used in generating the file's name;
may be suffix, String null, in which case ".tmp" is usedthe permissions string perms, Handler<AsyncResult<String>> the handler that will be called on completion handler)Creates a new file in the directory provided by the path |
| public Future | createTempFile(String dir, String prefix, String suffix, String perms)
Like |
| public String | createTempFileBlocking(String prefix, String suffix)
Blocking version of |
| public String | createTempFileBlocking(String prefix, String suffix, String perms)
Blocking version of |
| public String | createTempFileBlocking(String dir, String prefix, String suffix, String perms)
Blocking version of |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Deletes the file represented by the specified |
| public Future | |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, boolean delete recursively? recursive, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Deletes the file represented by the specified |
| public Future | deleteRecursive(String path, boolean recursive)
Like |
| public FileSystem | deleteRecursiveBlocking(String path, boolean recursive)
Blocking version of |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, Handler<AsyncResult<Boolean>> the handler that will be called on completion handler)Determines whether the file as specified by the path |
| public Future | |
| public boolean | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to anywhere on the filesystem path, Handler<AsyncResult<FileSystemProps>> the handler that will be called on completion handler)Returns properties of the file-system being used by the specified |
| public Future | |
| public FileSystemProps | |
| public FileSystem | |
| public Future | link(String link, String existing)
Like |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to the file path, Handler<AsyncResult<FileProps>> the handler that will be called on completion handler)Obtain properties for the link represented by |
| public Future | |
| public FileProps | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Create the directory represented by |
| public Future | |
| public FileSystem | |
| public Future | mkdir(String path, String perms)
Like |
| public FileSystem | |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Create the directory represented by |
| public Future | |
| public FileSystem | |
| public Future | mkdirs(String path, String perms)
Like |
| public FileSystem | |
| public FileSystem | |
| public FileSystem | |
| public Future | move(String from, String to)
Like |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to copy from from, String the path to copy to to, CopyOptions options describing how the file should be copied options, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Move a file from the path |
| public Future | move(String from, String to, CopyOptions options)
Like |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, OpenOptions options describing how the file should be opened options, Handler<AsyncResult<AsyncFile>> handler)Open the file represented by |
| public Future | open(String path, OpenOptions options)
Like |
| public AsyncFile | openBlocking(String path, OpenOptions options)
Blocking version of |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to the file path, Handler<AsyncResult<FileProps>> the handler that will be called on completion handler)Obtain properties for the file represented by |
| public Future | |
| public FileProps | |
| public FileSystem | |
| public Future | |
| public FileSystem | |
| public Future | readDir(String path, String filter)
Like |
| public List | |
| public List | |
| public FileSystem | |
| public Future | |
| public Buffer | readFileBlocking(String path)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Blocking version of |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe link link, Handler<AsyncResult<String>> the handler that will be called on completion handler)Returns the path representing the file that the symbolic link specified by |
| public Future | readSymlink(String link)
Like |
| public String | |
| public FileSystem | |
| public Future | symlink(String link, String existing)
Like |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe path to the file path, long the length to truncate it to len, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Truncate the file represented by |
| public Future | truncate(String path, long len)
Like |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlythe link link, Handler<AsyncResult<Void>> the handler that will be called on completion handler)Unlinks the link on the file system represented by the path |
| public Future | |
| public FileSystem | |
| public FileSystem | Returns: a reference to this, so the API can be used fluentlypath to the file path, Buffer data, Handler<AsyncResult<Void>> the handler that will be called on completion handler)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Creates the file, and writes the specified |
| public Future | writeFile(String path, Buffer data)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Like |
| public FileSystem | writeFileBlocking(String path, Buffer data)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Blocking version of |