Class FileSystem
- java.lang.Object
-
- io.vertx.reactivex.core.file.FileSystem
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
public class FileSystem extends Object implements io.vertx.lang.rx.RxDelegate
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
xxxBlockingand 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.
NOTE: This class has been automatically generated from the
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<FileSystem>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description FileSystem(FileSystem delegate)FileSystem(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<Void>chmod(String path, String perms)Change the permissions on the file represented bypathtoperms, asynchronously.FileSystemchmodBlocking(String path, String perms)Blocking version of#chmod(String, String)Future<Void>chmodRecursive(String path, String perms, String dirPerms)Change the permissions on the file represented bypathtoperms, asynchronously.FileSystemchmodRecursiveBlocking(String path, String perms, String dirPerms)Blocking version ofchmodRecursive(java.lang.String, java.lang.String, java.lang.String)Future<Void>chown(String path, String user, String group)Change the ownership on the file represented bypathtouserand {code group}, asynchronously.FileSystemchownBlocking(String path, String user, String group)Blocking version ofchown(java.lang.String, java.lang.String, java.lang.String)Future<Void>copy(String from, String to)Copy a file from the pathfromto pathto, asynchronously.Future<Void>copy(String from, String to, CopyOptions options)Copy a file from the pathfromto pathto, asynchronously.FileSystemcopyBlocking(String from, String to)Blocking version ofcopy(java.lang.String, java.lang.String)Future<Void>copyRecursive(String from, String to, boolean recursive)Copy a file from the pathfromto pathto, asynchronously.FileSystemcopyRecursiveBlocking(String from, String to, boolean recursive)Blocking version ofcopyRecursive(java.lang.String, java.lang.String, boolean)Future<Void>createFile(String path)Creates an empty file with the specifiedpath, asynchronously.Future<Void>createFile(String path, String perms)Creates an empty file with the specifiedpathand permissionsperms, asynchronously.FileSystemcreateFileBlocking(String path)Blocking version ofcreateFile(java.lang.String)FileSystemcreateFileBlocking(String path, String perms)Blocking version ofcreateFile(java.lang.String)Future<String>createTempDirectory(String prefix)Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.Future<String>createTempDirectory(String prefix, String perms)Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.Future<String>createTempDirectory(String dir, String prefix, String perms)Creates a new directory in the directory provided by the pathpath, using the given prefix to generate its name, asynchronously.StringcreateTempDirectoryBlocking(String prefix)Blocking version ofcreateTempDirectory(java.lang.String)StringcreateTempDirectoryBlocking(String prefix, String perms)Blocking version ofcreateTempDirectory(java.lang.String)StringcreateTempDirectoryBlocking(String dir, String prefix, String perms)Blocking version ofcreateTempDirectory(java.lang.String)Future<String>createTempFile(String prefix, String suffix)Creates a new file in the default temporary-file directory, using the given prefix and suffix to generate its name, asynchronously.Future<String>createTempFile(String prefix, String suffix, String perms)Creates a new file in the directory provided by the pathdir, using the given prefix and suffix to generate its name, asynchronously.Future<String>createTempFile(String dir, String prefix, String suffix, String perms)Creates a new file in the directory provided by the pathdir, using the given prefix and suffix to generate its name, asynchronously.StringcreateTempFileBlocking(String prefix, String suffix)Blocking version ofcreateTempFile(java.lang.String, java.lang.String)StringcreateTempFileBlocking(String prefix, String suffix, String perms)Blocking version ofcreateTempFile(java.lang.String, java.lang.String)StringcreateTempFileBlocking(String dir, String prefix, String suffix, String perms)Blocking version ofcreateTempFile(java.lang.String, java.lang.String)Future<Void>delete(String path)Deletes the file represented by the specifiedpath, asynchronously.FileSystemdeleteBlocking(String path)Blocking version ofdelete(java.lang.String)Future<Void>deleteRecursive(String path)Deletes the file represented by the specifiedpath, asynchronously.FileSystemdeleteRecursiveBlocking(String path)Blocking version ofdeleteRecursive(java.lang.String)booleanequals(Object o)Future<Boolean>exists(String path)Determines whether the file as specified by the pathpathexists, asynchronously.booleanexistsBlocking(String path)Blocking version ofexists(java.lang.String)Future<FileSystemProps>fsProps(String path)Returns properties of the file-system being used by the specifiedpath, asynchronously.FileSystemPropsfsPropsBlocking(String path)Blocking version offsProps(java.lang.String)FileSystemgetDelegate()inthashCode()Future<Void>link(String link, String existing)Create a hard link on the file system fromlinktoexisting, asynchronously.FileSystemlinkBlocking(String link, String existing)Blocking version oflink(java.lang.String, java.lang.String)Future<FileProps>lprops(String path)Obtain properties for the link represented bypath, asynchronously.FilePropslpropsBlocking(String path)Blocking version oflprops(java.lang.String)Future<Void>mkdir(String path)Create the directory represented bypath, asynchronously.Future<Void>mkdir(String path, String perms)Create the directory represented bypath, asynchronously.FileSystemmkdirBlocking(String path)Blocking version ofmkdir(java.lang.String)FileSystemmkdirBlocking(String path, String perms)Blocking version ofmkdir(java.lang.String)Future<Void>mkdirs(String path)Create the directory represented bypathand any non existent parents, asynchronously.Future<Void>mkdirs(String path, String perms)Create the directory represented bypathand any non existent parents, asynchronously.FileSystemmkdirsBlocking(String path)Blocking version ofmkdirs(java.lang.String)FileSystemmkdirsBlocking(String path, String perms)Blocking version ofmkdirs(java.lang.String)Future<Void>move(String from, String to)Move a file from the pathfromto pathto, asynchronously.Future<Void>move(String from, String to, CopyOptions options)Move a file from the pathfromto pathto, asynchronously.FileSystemmoveBlocking(String from, String to)Blocking version ofmove(java.lang.String, java.lang.String)static FileSystemnewInstance(FileSystem arg)Future<AsyncFile>open(String path, OpenOptions options)Open the file represented bypath, asynchronously.AsyncFileopenBlocking(String path, OpenOptions options)Blocking version ofopen(java.lang.String, io.vertx.core.file.OpenOptions)Future<FileProps>props(String path)Obtain properties for the file represented bypath, asynchronously.FilePropspropsBlocking(String path)Blocking version ofprops(java.lang.String)Future<List<String>>readDir(String path)Read the contents of the directory specified bypath, asynchronously.Future<List<String>>readDir(String path, String filter)Read the contents of the directory specified bypath, asynchronously.List<String>readDirBlocking(String path)Blocking version ofreadDir(java.lang.String)List<String>readDirBlocking(String path, String filter)Blocking version ofreadDir(java.lang.String)Future<Buffer>readFile(String path)Reads the entire file as represented by the pathpathas a , asynchronously.BufferreadFileBlocking(String path)Blocking version ofreadFile(java.lang.String)Future<String>readSymlink(String link)Returns the path representing the file that the symbolic link specified bylinkpoints to, asynchronously.StringreadSymlinkBlocking(String link)Blocking version ofreadSymlink(java.lang.String)CompletablerxChmod(String path, String perms)Change the permissions on the file represented bypathtoperms, asynchronously.CompletablerxChmodRecursive(String path, String perms, String dirPerms)Change the permissions on the file represented bypathtoperms, asynchronously.CompletablerxChown(String path, String user, String group)Change the ownership on the file represented bypathtouserand {code group}, asynchronously.CompletablerxCopy(String from, String to)Copy a file from the pathfromto pathto, asynchronously.CompletablerxCopy(String from, String to, CopyOptions options)Copy a file from the pathfromto pathto, asynchronously.CompletablerxCopyRecursive(String from, String to, boolean recursive)Copy a file from the pathfromto pathto, asynchronously.CompletablerxCreateFile(String path)Creates an empty file with the specifiedpath, asynchronously.CompletablerxCreateFile(String path, String perms)Creates an empty file with the specifiedpathand permissionsperms, asynchronously.Single<String>rxCreateTempDirectory(String prefix)Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.Single<String>rxCreateTempDirectory(String prefix, String perms)Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.Single<String>rxCreateTempDirectory(String dir, String prefix, String perms)Creates a new directory in the directory provided by the pathpath, using the given prefix to generate its name, asynchronously.Single<String>rxCreateTempFile(String prefix, String suffix)Creates a new file in the default temporary-file directory, using the given prefix and suffix to generate its name, asynchronously.Single<String>rxCreateTempFile(String prefix, String suffix, String perms)Creates a new file in the directory provided by the pathdir, using the given prefix and suffix to generate its name, asynchronously.Single<String>rxCreateTempFile(String dir, String prefix, String suffix, String perms)Creates a new file in the directory provided by the pathdir, using the given prefix and suffix to generate its name, asynchronously.CompletablerxDelete(String path)Deletes the file represented by the specifiedpath, asynchronously.CompletablerxDeleteRecursive(String path)Deletes the file represented by the specifiedpath, asynchronously.Single<Boolean>rxExists(String path)Determines whether the file as specified by the pathpathexists, asynchronously.Single<FileSystemProps>rxFsProps(String path)Returns properties of the file-system being used by the specifiedpath, asynchronously.CompletablerxLink(String link, String existing)Create a hard link on the file system fromlinktoexisting, asynchronously.Single<FileProps>rxLprops(String path)Obtain properties for the link represented bypath, asynchronously.CompletablerxMkdir(String path)Create the directory represented bypath, asynchronously.CompletablerxMkdir(String path, String perms)Create the directory represented bypath, asynchronously.CompletablerxMkdirs(String path)Create the directory represented bypathand any non existent parents, asynchronously.CompletablerxMkdirs(String path, String perms)Create the directory represented bypathand any non existent parents, asynchronously.CompletablerxMove(String from, String to)Move a file from the pathfromto pathto, asynchronously.CompletablerxMove(String from, String to, CopyOptions options)Move a file from the pathfromto pathto, asynchronously.Single<AsyncFile>rxOpen(String path, OpenOptions options)Open the file represented bypath, asynchronously.Single<FileProps>rxProps(String path)Obtain properties for the file represented bypath, asynchronously.Single<List<String>>rxReadDir(String path)Read the contents of the directory specified bypath, asynchronously.Single<List<String>>rxReadDir(String path, String filter)Read the contents of the directory specified bypath, asynchronously.Single<Buffer>rxReadFile(String path)Reads the entire file as represented by the pathpathas a , asynchronously.Single<String>rxReadSymlink(String link)Returns the path representing the file that the symbolic link specified bylinkpoints to, asynchronously.CompletablerxSymlink(String link, String existing)Create a symbolic link on the file system fromlinktoexisting, asynchronously.CompletablerxTruncate(String path, long len)Truncate the file represented bypathto lengthlenin bytes, asynchronously.CompletablerxUnlink(String link)Unlinks the link on the file system represented by the pathlink, asynchronously.CompletablerxWriteFile(String path, Buffer data)Creates the file, and writes the specifiedBuffer datato the file represented by the pathpath, asynchronously.Future<Void>symlink(String link, String existing)Create a symbolic link on the file system fromlinktoexisting, asynchronously.FileSystemsymlinkBlocking(String link, String existing)Blocking version oflink(java.lang.String, java.lang.String)StringtoString()Future<Void>truncate(String path, long len)Truncate the file represented bypathto lengthlenin bytes, asynchronously.FileSystemtruncateBlocking(String path, long len)Blocking version oftruncate(java.lang.String, long)Future<Void>unlink(String link)Unlinks the link on the file system represented by the pathlink, asynchronously.FileSystemunlinkBlocking(String link)Blocking version ofunlink(java.lang.String)Future<Void>writeFile(String path, Buffer data)Creates the file, and writes the specifiedBuffer datato the file represented by the pathpath, asynchronously.FileSystemwriteFileBlocking(String path, Buffer data)Blocking version ofwriteFile(java.lang.String, io.vertx.core.buffer.Buffer)
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<FileSystem> __TYPE_ARG
-
-
Constructor Detail
-
FileSystem
public FileSystem(FileSystem delegate)
-
FileSystem
public FileSystem(Object delegate)
-
-
Method Detail
-
getDelegate
public FileSystem getDelegate()
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
copy
public Future<Void> copy(String from, String to)
Copy a file from the pathfromto pathto, asynchronously.The copy will fail if the destination already exists.
- Parameters:
from- the path to copy fromto- the path to copy to- Returns:
- a future notified on completion
-
rxCopy
public Completable rxCopy(String from, String to)
Copy a file from the pathfromto pathto, asynchronously.The copy will fail if the destination already exists.
- Parameters:
from- the path to copy fromto- the path to copy to- Returns:
- a future notified on completion
-
copy
public Future<Void> copy(String from, String to, CopyOptions options)
Copy a file from the pathfromto pathto, asynchronously.- Parameters:
from- the path to copy fromto- the path to copy tooptions- options describing how the file should be copied- Returns:
- a future notified on completion
-
rxCopy
public Completable rxCopy(String from, String to, CopyOptions options)
Copy a file from the pathfromto pathto, asynchronously.- Parameters:
from- the path to copy fromto- the path to copy tooptions- options describing how the file should be copied- Returns:
- a future notified on completion
-
copyBlocking
public FileSystem copyBlocking(String from, String to)
Blocking version ofcopy(java.lang.String, java.lang.String)- Parameters:
from-to-- Returns:
-
copyRecursive
public Future<Void> copyRecursive(String from, String to, boolean recursive)
Copy a file from the pathfromto pathto, asynchronously.If
recursiveistrueandfromrepresents a directory, then the directory and its contents will be copied recursively to the destinationto.The copy will fail if the destination if the destination already exists.
- Parameters:
from- the path to copy fromto- the path to copy torecursive-- Returns:
- a future notified on completion
-
rxCopyRecursive
public Completable rxCopyRecursive(String from, String to, boolean recursive)
Copy a file from the pathfromto pathto, asynchronously.If
recursiveistrueandfromrepresents a directory, then the directory and its contents will be copied recursively to the destinationto.The copy will fail if the destination if the destination already exists.
- Parameters:
from- the path to copy fromto- the path to copy torecursive-- Returns:
- a future notified on completion
-
copyRecursiveBlocking
public FileSystem copyRecursiveBlocking(String from, String to, boolean recursive)
Blocking version ofcopyRecursive(java.lang.String, java.lang.String, boolean)- Parameters:
from-to-recursive-- Returns:
-
move
public Future<Void> move(String from, String to)
Move a file from the pathfromto pathto, asynchronously.The move will fail if the destination already exists.
- Parameters:
from- the path to copy fromto- the path to copy to- Returns:
- a future notified on completion
-
rxMove
public Completable rxMove(String from, String to)
Move a file from the pathfromto pathto, asynchronously.The move will fail if the destination already exists.
- Parameters:
from- the path to copy fromto- the path to copy to- Returns:
- a future notified on completion
-
move
public Future<Void> move(String from, String to, CopyOptions options)
Move a file from the pathfromto pathto, asynchronously.- Parameters:
from- the path to copy fromto- the path to copy tooptions- options describing how the file should be copied- Returns:
- a future notified on completion
-
rxMove
public Completable rxMove(String from, String to, CopyOptions options)
Move a file from the pathfromto pathto, asynchronously.- Parameters:
from- the path to copy fromto- the path to copy tooptions- options describing how the file should be copied- Returns:
- a future notified on completion
-
moveBlocking
public FileSystem moveBlocking(String from, String to)
Blocking version ofmove(java.lang.String, java.lang.String)- Parameters:
from-to-- Returns:
-
truncate
public Future<Void> truncate(String path, long len)
Truncate the file represented bypathto lengthlenin bytes, asynchronously.The operation will fail if the file does not exist or
lenis less thanzero.- Parameters:
path- the path to the filelen- the length to truncate it to- Returns:
- a future notified on completion
-
rxTruncate
public Completable rxTruncate(String path, long len)
Truncate the file represented bypathto lengthlenin bytes, asynchronously.The operation will fail if the file does not exist or
lenis less thanzero.- Parameters:
path- the path to the filelen- the length to truncate it to- Returns:
- a future notified on completion
-
truncateBlocking
public FileSystem truncateBlocking(String path, long len)
Blocking version oftruncate(java.lang.String, long)- Parameters:
path-len-- Returns:
-
chmod
public Future<Void> chmod(String path, String perms)
Change the permissions on the file represented bypathtoperms, asynchronously.The permission String takes the form rwxr-x--- as specified here.
- Parameters:
path- the path to the fileperms- the permissions string- Returns:
- a future notified on completion
-
rxChmod
public Completable rxChmod(String path, String perms)
Change the permissions on the file represented bypathtoperms, asynchronously.The permission String takes the form rwxr-x--- as specified here.
- Parameters:
path- the path to the fileperms- the permissions string- Returns:
- a future notified on completion
-
chmodBlocking
public FileSystem chmodBlocking(String path, String perms)
Blocking version of#chmod(String, String)- Parameters:
path-perms-- Returns:
-
chmodRecursive
public Future<Void> chmodRecursive(String path, String perms, String dirPerms)
Change the permissions on the file represented bypathtoperms, asynchronously.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
dirPerms, whilst any normal file permissions will be set toperms.- Parameters:
path- the path to the fileperms- the permissions stringdirPerms- the directory permissions- Returns:
- a future notified on completion
-
rxChmodRecursive
public Completable rxChmodRecursive(String path, String perms, String dirPerms)
Change the permissions on the file represented bypathtoperms, asynchronously.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
dirPerms, whilst any normal file permissions will be set toperms.- Parameters:
path- the path to the fileperms- the permissions stringdirPerms- the directory permissions- Returns:
- a future notified on completion
-
chmodRecursiveBlocking
public FileSystem chmodRecursiveBlocking(String path, String perms, String dirPerms)
Blocking version ofchmodRecursive(java.lang.String, java.lang.String, java.lang.String)- Parameters:
path-perms-dirPerms-- Returns:
-
chown
public Future<Void> chown(String path, String user, String group)
Change the ownership on the file represented bypathtouserand {code group}, asynchronously.- Parameters:
path- the path to the fileuser- the user name,nullwill not change the user namegroup- the user group,nullwill not change the user group name- Returns:
- a future notified on completion
-
rxChown
public Completable rxChown(String path, String user, String group)
Change the ownership on the file represented bypathtouserand {code group}, asynchronously.- Parameters:
path- the path to the fileuser- the user name,nullwill not change the user namegroup- the user group,nullwill not change the user group name- Returns:
- a future notified on completion
-
chownBlocking
public FileSystem chownBlocking(String path, String user, String group)
Blocking version ofchown(java.lang.String, java.lang.String, java.lang.String)- Parameters:
path-user-group-- Returns:
-
props
public Future<FileProps> props(String path)
Obtain properties for the file represented bypath, asynchronously.If the file is a link, the link will be followed.
- Parameters:
path- the path to the file- Returns:
- a future notified on completion
-
rxProps
public Single<FileProps> rxProps(String path)
Obtain properties for the file represented bypath, asynchronously.If the file is a link, the link will be followed.
- Parameters:
path- the path to the file- Returns:
- a future notified on completion
-
propsBlocking
public FileProps propsBlocking(String path)
Blocking version ofprops(java.lang.String)- Parameters:
path-- Returns:
-
lprops
public Future<FileProps> lprops(String path)
Obtain properties for the link represented bypath, asynchronously.The link will not be followed.
- Parameters:
path- the path to the file- Returns:
- a future notified on completion
-
rxLprops
public Single<FileProps> rxLprops(String path)
Obtain properties for the link represented bypath, asynchronously.The link will not be followed.
- Parameters:
path- the path to the file- Returns:
- a future notified on completion
-
lpropsBlocking
public FileProps lpropsBlocking(String path)
Blocking version oflprops(java.lang.String)- Parameters:
path-- Returns:
-
link
public Future<Void> link(String link, String existing)
Create a hard link on the file system fromlinktoexisting, asynchronously.- Parameters:
link- the linkexisting- the link destination- Returns:
- a future notified on completion
-
rxLink
public Completable rxLink(String link, String existing)
Create a hard link on the file system fromlinktoexisting, asynchronously.- Parameters:
link- the linkexisting- the link destination- Returns:
- a future notified on completion
-
linkBlocking
public FileSystem linkBlocking(String link, String existing)
Blocking version oflink(java.lang.String, java.lang.String)- Parameters:
link-existing-- Returns:
-
symlink
public Future<Void> symlink(String link, String existing)
Create a symbolic link on the file system fromlinktoexisting, asynchronously.- Parameters:
link- the linkexisting- the link destination- Returns:
- a future notified on completion
-
rxSymlink
public Completable rxSymlink(String link, String existing)
Create a symbolic link on the file system fromlinktoexisting, asynchronously.- Parameters:
link- the linkexisting- the link destination- Returns:
- a future notified on completion
-
symlinkBlocking
public FileSystem symlinkBlocking(String link, String existing)
Blocking version oflink(java.lang.String, java.lang.String)- Parameters:
link-existing-- Returns:
-
unlink
public Future<Void> unlink(String link)
Unlinks the link on the file system represented by the pathlink, asynchronously.- Parameters:
link- the link- Returns:
- a future notified on completion
-
rxUnlink
public Completable rxUnlink(String link)
Unlinks the link on the file system represented by the pathlink, asynchronously.- Parameters:
link- the link- Returns:
- a future notified on completion
-
unlinkBlocking
public FileSystem unlinkBlocking(String link)
Blocking version ofunlink(java.lang.String)- Parameters:
link-- Returns:
-
readSymlink
public Future<String> readSymlink(String link)
Returns the path representing the file that the symbolic link specified bylinkpoints to, asynchronously.- Parameters:
link- the link- Returns:
- a future notified on completion
-
rxReadSymlink
public Single<String> rxReadSymlink(String link)
Returns the path representing the file that the symbolic link specified bylinkpoints to, asynchronously.- Parameters:
link- the link- Returns:
- a future notified on completion
-
readSymlinkBlocking
public String readSymlinkBlocking(String link)
Blocking version ofreadSymlink(java.lang.String)- Parameters:
link-- Returns:
-
delete
public Future<Void> delete(String path)
Deletes the file represented by the specifiedpath, asynchronously.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
rxDelete
public Completable rxDelete(String path)
Deletes the file represented by the specifiedpath, asynchronously.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
deleteBlocking
public FileSystem deleteBlocking(String path)
Blocking version ofdelete(java.lang.String)- Parameters:
path-- Returns:
-
deleteRecursive
public Future<Void> deleteRecursive(String path)
Deletes the file represented by the specifiedpath, asynchronously.If the path represents a directory and
recursive = truethen the directory and its contents will be deleted recursively.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
rxDeleteRecursive
public Completable rxDeleteRecursive(String path)
Deletes the file represented by the specifiedpath, asynchronously.If the path represents a directory and
recursive = truethen the directory and its contents will be deleted recursively.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
deleteRecursiveBlocking
public FileSystem deleteRecursiveBlocking(String path)
Blocking version ofdeleteRecursive(java.lang.String)- Parameters:
path-- Returns:
-
mkdir
public Future<Void> mkdir(String path)
Create the directory represented bypath, asynchronously.The operation will fail if the directory already exists.
- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
rxMkdir
public Completable rxMkdir(String path)
Create the directory represented bypath, asynchronously.The operation will fail if the directory already exists.
- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
mkdirBlocking
public FileSystem mkdirBlocking(String path)
Blocking version ofmkdir(java.lang.String)- Parameters:
path-- Returns:
-
mkdir
public Future<Void> mkdir(String path, String perms)
Create the directory represented bypath, asynchronously.The new directory will be created with permissions as specified by
perms.The permission String takes the form rwxr-x--- as specified in here.
The operation will fail if the directory already exists.
- Parameters:
path- path to the fileperms- the permissions string- Returns:
- a future notified on completion
-
rxMkdir
public Completable rxMkdir(String path, String perms)
Create the directory represented bypath, asynchronously.The new directory will be created with permissions as specified by
perms.The permission String takes the form rwxr-x--- as specified in here.
The operation will fail if the directory already exists.
- Parameters:
path- path to the fileperms- the permissions string- Returns:
- a future notified on completion
-
mkdirBlocking
public FileSystem mkdirBlocking(String path, String perms)
Blocking version ofmkdir(java.lang.String)- Parameters:
path-perms-- Returns:
-
mkdirs
public Future<Void> mkdirs(String path)
Create the directory represented bypathand any non existent parents, asynchronously.The operation will fail if the
pathalready exists but is not a directory.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
rxMkdirs
public Completable rxMkdirs(String path)
Create the directory represented bypathand any non existent parents, asynchronously.The operation will fail if the
pathalready exists but is not a directory.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
mkdirsBlocking
public FileSystem mkdirsBlocking(String path)
Blocking version ofmkdirs(java.lang.String)- Parameters:
path-- Returns:
-
mkdirs
public Future<Void> mkdirs(String path, String perms)
Create the directory represented bypathand any non existent parents, asynchronously.The new directory will be created with permissions as specified by
perms.The permission String takes the form rwxr-x--- as specified in here.
The operation will fail if the
pathalready exists but is not a directory.- Parameters:
path- path to the fileperms- the permissions string- Returns:
- a future notified on completion
-
rxMkdirs
public Completable rxMkdirs(String path, String perms)
Create the directory represented bypathand any non existent parents, asynchronously.The new directory will be created with permissions as specified by
perms.The permission String takes the form rwxr-x--- as specified in here.
The operation will fail if the
pathalready exists but is not a directory.- Parameters:
path- path to the fileperms- the permissions string- Returns:
- a future notified on completion
-
mkdirsBlocking
public FileSystem mkdirsBlocking(String path, String perms)
Blocking version ofmkdirs(java.lang.String)- Parameters:
path-perms-- Returns:
-
readDir
public Future<List<String>> readDir(String path)
Read the contents of the directory specified bypath, asynchronously.The result is an array of String representing the paths of the files inside the directory.
- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
rxReadDir
public Single<List<String>> rxReadDir(String path)
Read the contents of the directory specified bypath, asynchronously.The result is an array of String representing the paths of the files inside the directory.
- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
readDirBlocking
public List<String> readDirBlocking(String path)
Blocking version ofreadDir(java.lang.String)- Parameters:
path-- Returns:
-
readDir
public Future<List<String>> readDir(String path, String filter)
Read the contents of the directory specified bypath, asynchronously.The parameter
filteris a regular expression. Iffilteris specified then only the paths that match @{filter}will be returned.The result is an array of String representing the paths of the files inside the directory.
- Parameters:
path- path to the directoryfilter- the filter expression- Returns:
- a future notified on completion
-
rxReadDir
public Single<List<String>> rxReadDir(String path, String filter)
Read the contents of the directory specified bypath, asynchronously.The parameter
filteris a regular expression. Iffilteris specified then only the paths that match @{filter}will be returned.The result is an array of String representing the paths of the files inside the directory.
- Parameters:
path- path to the directoryfilter- the filter expression- Returns:
- a future notified on completion
-
readDirBlocking
public List<String> readDirBlocking(String path, String filter)
Blocking version ofreadDir(java.lang.String)- Parameters:
path-filter-- Returns:
-
readFile
public Future<Buffer> readFile(String path)
Reads the entire file as represented by the pathpathas a , asynchronously.Do not use this method to read very large files or you risk running out of available RAM.
- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
rxReadFile
public Single<Buffer> rxReadFile(String path)
Reads the entire file as represented by the pathpathas a , asynchronously.Do not use this method to read very large files or you risk running out of available RAM.
- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
readFileBlocking
public Buffer readFileBlocking(String path)
Blocking version ofreadFile(java.lang.String)- Parameters:
path-- Returns:
-
writeFile
public Future<Void> writeFile(String path, Buffer data)
Creates the file, and writes the specifiedBuffer datato the file represented by the pathpath, asynchronously.- Parameters:
path- path to the filedata-- Returns:
- a future notified on completion
-
rxWriteFile
public Completable rxWriteFile(String path, Buffer data)
Creates the file, and writes the specifiedBuffer datato the file represented by the pathpath, asynchronously.- Parameters:
path- path to the filedata-- Returns:
- a future notified on completion
-
writeFileBlocking
public FileSystem writeFileBlocking(String path, Buffer data)
Blocking version ofwriteFile(java.lang.String, io.vertx.core.buffer.Buffer)- Parameters:
path-data-- Returns:
-
open
public Future<AsyncFile> open(String path, OpenOptions options)
Open the file represented bypath, asynchronously.The file is opened for both reading and writing. If the file does not already exist it will be created.
- Parameters:
path- path to the fileoptions- options describing how the file should be opened- Returns:
- a future notified on completion
-
rxOpen
public Single<AsyncFile> rxOpen(String path, OpenOptions options)
Open the file represented bypath, asynchronously.The file is opened for both reading and writing. If the file does not already exist it will be created.
- Parameters:
path- path to the fileoptions- options describing how the file should be opened- Returns:
- a future notified on completion
-
openBlocking
public AsyncFile openBlocking(String path, OpenOptions options)
Blocking version ofopen(java.lang.String, io.vertx.core.file.OpenOptions)- Parameters:
path-options-- Returns:
-
createFile
public Future<Void> createFile(String path)
Creates an empty file with the specifiedpath, asynchronously.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
rxCreateFile
public Completable rxCreateFile(String path)
Creates an empty file with the specifiedpath, asynchronously.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
createFileBlocking
public FileSystem createFileBlocking(String path)
Blocking version ofcreateFile(java.lang.String)- Parameters:
path-- Returns:
-
createFile
public Future<Void> createFile(String path, String perms)
Creates an empty file with the specifiedpathand permissionsperms, asynchronously.- Parameters:
path- path to the fileperms- the permissions string- Returns:
- a future notified on completion
-
rxCreateFile
public Completable rxCreateFile(String path, String perms)
Creates an empty file with the specifiedpathand permissionsperms, asynchronously.- Parameters:
path- path to the fileperms- the permissions string- Returns:
- a future notified on completion
-
createFileBlocking
public FileSystem createFileBlocking(String path, String perms)
Blocking version ofcreateFile(java.lang.String)- Parameters:
path-perms-- Returns:
-
exists
public Future<Boolean> exists(String path)
Determines whether the file as specified by the pathpathexists, asynchronously.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
rxExists
public Single<Boolean> rxExists(String path)
Determines whether the file as specified by the pathpathexists, asynchronously.- Parameters:
path- path to the file- Returns:
- a future notified on completion
-
existsBlocking
public boolean existsBlocking(String path)
Blocking version ofexists(java.lang.String)- Parameters:
path-- Returns:
-
fsProps
public Future<FileSystemProps> fsProps(String path)
Returns properties of the file-system being used by the specifiedpath, asynchronously.- Parameters:
path- path to anywhere on the filesystem- Returns:
- a future notified on completion
-
rxFsProps
public Single<FileSystemProps> rxFsProps(String path)
Returns properties of the file-system being used by the specifiedpath, asynchronously.- Parameters:
path- path to anywhere on the filesystem- Returns:
- a future notified on completion
-
fsPropsBlocking
public FileSystemProps fsPropsBlocking(String path)
Blocking version offsProps(java.lang.String)- Parameters:
path-- Returns:
-
createTempDirectory
public Future<String> createTempDirectory(String prefix)
Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
prefix- the prefix string to be used in generating the directory's name; may benull- Returns:
- a future notified on completion
-
rxCreateTempDirectory
public Single<String> rxCreateTempDirectory(String prefix)
Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
prefix- the prefix string to be used in generating the directory's name; may benull- Returns:
- a future notified on completion
-
createTempDirectoryBlocking
public String createTempDirectoryBlocking(String prefix)
Blocking version ofcreateTempDirectory(java.lang.String)- Parameters:
prefix-- Returns:
-
createTempDirectory
public Future<String> createTempDirectory(String prefix, String perms)
Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.The new directory will be created with permissions as specified by
The permission String takes the form rwxr-x--- as specified in here.perms.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
prefix- the prefix string to be used in generating the directory's name; may benullperms- the permissions string- Returns:
- a future notified on completion
-
rxCreateTempDirectory
public Single<String> rxCreateTempDirectory(String prefix, String perms)
Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.The new directory will be created with permissions as specified by
The permission String takes the form rwxr-x--- as specified in here.perms.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
prefix- the prefix string to be used in generating the directory's name; may benullperms- the permissions string- Returns:
- a future notified on completion
-
createTempDirectoryBlocking
public String createTempDirectoryBlocking(String prefix, String perms)
Blocking version ofcreateTempDirectory(java.lang.String)- Parameters:
prefix-perms-- Returns:
-
createTempDirectory
public Future<String> createTempDirectory(String dir, String prefix, String perms)
Creates a new directory in the directory provided by the pathpath, using the given prefix to generate its name, asynchronously.The new directory will be created with permissions as specified by
The permission String takes the form rwxr-x--- as specified in here.perms.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
dir- the path to directory in which to create the directoryprefix- the prefix string to be used in generating the directory's name; may benullperms- the permissions string- Returns:
- a future notified on completion
-
rxCreateTempDirectory
public Single<String> rxCreateTempDirectory(String dir, String prefix, String perms)
Creates a new directory in the directory provided by the pathpath, using the given prefix to generate its name, asynchronously.The new directory will be created with permissions as specified by
The permission String takes the form rwxr-x--- as specified in here.perms.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
dir- the path to directory in which to create the directoryprefix- the prefix string to be used in generating the directory's name; may benullperms- the permissions string- Returns:
- a future notified on completion
-
createTempDirectoryBlocking
public String createTempDirectoryBlocking(String dir, String prefix, String perms)
Blocking version ofcreateTempDirectory(java.lang.String)- Parameters:
dir-prefix-perms-- Returns:
-
createTempFile
public Future<String> createTempFile(String prefix, String suffix)
Creates a new file in the default temporary-file directory, using the given prefix and suffix to generate its name, asynchronously.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
prefix- the prefix string to be used in generating the directory's name; may benullsuffix- the suffix string to be used in generating the file's name; may benull, in which case ".tmp" is used- Returns:
- a future notified on completion
-
rxCreateTempFile
public Single<String> rxCreateTempFile(String prefix, String suffix)
Creates a new file in the default temporary-file directory, using the given prefix and suffix to generate its name, asynchronously.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
prefix- the prefix string to be used in generating the directory's name; may benullsuffix- the suffix string to be used in generating the file's name; may benull, in which case ".tmp" is used- Returns:
- a future notified on completion
-
createTempFileBlocking
public String createTempFileBlocking(String prefix, String suffix)
Blocking version ofcreateTempFile(java.lang.String, java.lang.String)- Parameters:
prefix-suffix-- Returns:
-
createTempFile
public Future<String> createTempFile(String prefix, String suffix, String perms)
Creates a new file in the directory provided by the pathdir, using the given prefix and suffix to generate its name, asynchronously.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
prefix- the prefix string to be used in generating the directory's name; may benullsuffix- the suffix string to be used in generating the file's name; may benull, in which case ".tmp" is usedperms-- Returns:
- a future notified on completion
-
rxCreateTempFile
public Single<String> rxCreateTempFile(String prefix, String suffix, String perms)
Creates a new file in the directory provided by the pathdir, using the given prefix and suffix to generate its name, asynchronously.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
prefix- the prefix string to be used in generating the directory's name; may benullsuffix- the suffix string to be used in generating the file's name; may benull, in which case ".tmp" is usedperms-- Returns:
- a future notified on completion
-
createTempFileBlocking
public String createTempFileBlocking(String prefix, String suffix, String perms)
Blocking version ofcreateTempFile(java.lang.String, java.lang.String)- Parameters:
prefix-suffix-perms-- Returns:
-
createTempFile
public Future<String> createTempFile(String dir, String prefix, String suffix, String perms)
Creates a new file in the directory provided by the pathdir, using the given prefix and suffix to generate its name, asynchronously.The new directory will be created with permissions as specified by
The permission String takes the form rwxr-x--- as specified in here.perms.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
dir- the path to directory in which to create the directoryprefix- the prefix string to be used in generating the directory's name; may benullsuffix- the suffix string to be used in generating the file's name; may benull, in which case ".tmp" is usedperms- the permissions string- Returns:
- a future notified on completion
-
rxCreateTempFile
public Single<String> rxCreateTempFile(String dir, String prefix, String suffix, String perms)
Creates a new file in the directory provided by the pathdir, using the given prefix and suffix to generate its name, asynchronously.The new directory will be created with permissions as specified by
The permission String takes the form rwxr-x--- as specified in here.perms.As with the
File.createTempFilemethods, this method is only part of a temporary-file facility.ARuntime, or theFilemechanism may be used to delete the directory automatically.- Parameters:
dir- the path to directory in which to create the directoryprefix- the prefix string to be used in generating the directory's name; may benullsuffix- the suffix string to be used in generating the file's name; may benull, in which case ".tmp" is usedperms- the permissions string- Returns:
- a future notified on completion
-
createTempFileBlocking
public String createTempFileBlocking(String dir, String prefix, String suffix, String perms)
Blocking version ofcreateTempFile(java.lang.String, java.lang.String)- Parameters:
dir-prefix-suffix-perms-- Returns:
-
newInstance
public static FileSystem newInstance(FileSystem arg)
-
-