Class FileSystem


  • public class FileSystem
    extends Object
    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.

    NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

    • Constructor Detail

      • FileSystem

        public FileSystem​(FileSystem delegate)
      • FileSystem

        public FileSystem​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • copy

        public FileSystem copy​(String from,
                               String to,
                               Handler<AsyncResult<Void>> handler)
        Copy a file from the path from to path to, asynchronously.

        The copy will fail if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • copy

        public FileSystem copy​(String from,
                               String to)
        Copy a file from the path from to path to, asynchronously.

        The copy will fail if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        Returns:
        a reference to this, so the API can be used fluently
      • rxCopy

        public io.reactivex.Completable rxCopy​(String from,
                                               String to)
        Copy a file from the path from to path to, asynchronously.

        The copy will fail if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        Returns:
        a reference to this, so the API can be used fluently
      • copy

        public FileSystem copy​(String from,
                               String to,
                               CopyOptions options,
                               Handler<AsyncResult<Void>> handler)
        Copy a file from the path from to path to, asynchronously.
        Parameters:
        from - the path to copy from
        to - the path to copy to
        options - options describing how the file should be copied
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • copy

        public FileSystem copy​(String from,
                               String to,
                               CopyOptions options)
        Copy a file from the path from to path to, asynchronously.
        Parameters:
        from - the path to copy from
        to - the path to copy to
        options - options describing how the file should be copied
        Returns:
        a reference to this, so the API can be used fluently
      • rxCopy

        public io.reactivex.Completable rxCopy​(String from,
                                               String to,
                                               CopyOptions options)
        Copy a file from the path from to path to, asynchronously.
        Parameters:
        from - the path to copy from
        to - the path to copy to
        options - options describing how the file should be copied
        Returns:
        a reference to this, so the API can be used fluently
      • copyRecursive

        public FileSystem copyRecursive​(String from,
                                        String to,
                                        boolean recursive,
                                        Handler<AsyncResult<Void>> handler)
        Copy a file from the path from to path to, asynchronously.

        If recursive is true and from represents a directory, then the directory and its contents will be copied recursively to the destination to.

        The copy will fail if the destination if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        recursive -
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • copyRecursive

        public FileSystem copyRecursive​(String from,
                                        String to,
                                        boolean recursive)
        Copy a file from the path from to path to, asynchronously.

        If recursive is true and from represents a directory, then the directory and its contents will be copied recursively to the destination to.

        The copy will fail if the destination if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        recursive -
        Returns:
        a reference to this, so the API can be used fluently
      • rxCopyRecursive

        public io.reactivex.Completable rxCopyRecursive​(String from,
                                                        String to,
                                                        boolean recursive)
        Copy a file from the path from to path to, asynchronously.

        If recursive is true and from represents a directory, then the directory and its contents will be copied recursively to the destination to.

        The copy will fail if the destination if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        recursive -
        Returns:
        a reference to this, so the API can be used fluently
      • move

        public FileSystem move​(String from,
                               String to,
                               Handler<AsyncResult<Void>> handler)
        Move a file from the path from to path to, asynchronously.

        The move will fail if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • move

        public FileSystem move​(String from,
                               String to)
        Move a file from the path from to path to, asynchronously.

        The move will fail if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        Returns:
        a reference to this, so the API can be used fluently
      • rxMove

        public io.reactivex.Completable rxMove​(String from,
                                               String to)
        Move a file from the path from to path to, asynchronously.

        The move will fail if the destination already exists.

        Parameters:
        from - the path to copy from
        to - the path to copy to
        Returns:
        a reference to this, so the API can be used fluently
      • move

        public FileSystem move​(String from,
                               String to,
                               CopyOptions options,
                               Handler<AsyncResult<Void>> handler)
        Move a file from the path from to path to, asynchronously.
        Parameters:
        from - the path to copy from
        to - the path to copy to
        options - options describing how the file should be copied
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • move

        public FileSystem move​(String from,
                               String to,
                               CopyOptions options)
        Move a file from the path from to path to, asynchronously.
        Parameters:
        from - the path to copy from
        to - the path to copy to
        options - options describing how the file should be copied
        Returns:
        a reference to this, so the API can be used fluently
      • rxMove

        public io.reactivex.Completable rxMove​(String from,
                                               String to,
                                               CopyOptions options)
        Move a file from the path from to path to, asynchronously.
        Parameters:
        from - the path to copy from
        to - the path to copy to
        options - options describing how the file should be copied
        Returns:
        a reference to this, so the API can be used fluently
      • truncate

        public FileSystem truncate​(String path,
                                   long len,
                                   Handler<AsyncResult<Void>> handler)
        Truncate the file represented by path to length len in bytes, asynchronously.

        The operation will fail if the file does not exist or len is less than zero.

        Parameters:
        path - the path to the file
        len - the length to truncate it to
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • truncate

        public FileSystem truncate​(String path,
                                   long len)
        Truncate the file represented by path to length len in bytes, asynchronously.

        The operation will fail if the file does not exist or len is less than zero.

        Parameters:
        path - the path to the file
        len - the length to truncate it to
        Returns:
        a reference to this, so the API can be used fluently
      • rxTruncate

        public io.reactivex.Completable rxTruncate​(String path,
                                                   long len)
        Truncate the file represented by path to length len in bytes, asynchronously.

        The operation will fail if the file does not exist or len is less than zero.

        Parameters:
        path - the path to the file
        len - the length to truncate it to
        Returns:
        a reference to this, so the API can be used fluently
      • chmod

        public FileSystem chmod​(String path,
                                String perms,
                                Handler<AsyncResult<Void>> handler)
        Change the permissions on the file represented by path to perms, asynchronously.

        The permission String takes the form rwxr-x--- as specified here.

        Parameters:
        path - the path to the file
        perms - the permissions string
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • chmod

        public FileSystem chmod​(String path,
                                String perms)
        Change the permissions on the file represented by path to perms, asynchronously.

        The permission String takes the form rwxr-x--- as specified here.

        Parameters:
        path - the path to the file
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • rxChmod

        public io.reactivex.Completable rxChmod​(String path,
                                                String perms)
        Change the permissions on the file represented by path to perms, asynchronously.

        The permission String takes the form rwxr-x--- as specified here.

        Parameters:
        path - the path to the file
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • chmodRecursive

        public FileSystem chmodRecursive​(String path,
                                         String perms,
                                         String dirPerms,
                                         Handler<AsyncResult<Void>> handler)
        Change the permissions on the file represented by path to perms, 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 to perms.

        Parameters:
        path - the path to the file
        perms - the permissions string
        dirPerms - the directory permissions
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • chmodRecursive

        public FileSystem chmodRecursive​(String path,
                                         String perms,
                                         String dirPerms)
        Change the permissions on the file represented by path to perms, 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 to perms.

        Parameters:
        path - the path to the file
        perms - the permissions string
        dirPerms - the directory permissions
        Returns:
        a reference to this, so the API can be used fluently
      • rxChmodRecursive

        public io.reactivex.Completable rxChmodRecursive​(String path,
                                                         String perms,
                                                         String dirPerms)
        Change the permissions on the file represented by path to perms, 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 to perms.

        Parameters:
        path - the path to the file
        perms - the permissions string
        dirPerms - the directory permissions
        Returns:
        a reference to this, so the API can be used fluently
      • chown

        public FileSystem chown​(String path,
                                String user,
                                String group,
                                Handler<AsyncResult<Void>> handler)
        Change the ownership on the file represented by path to user and {code group}, asynchronously.
        Parameters:
        path - the path to the file
        user - the user name, null will not change the user name
        group - the user group, null will not change the user group name
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • chown

        public FileSystem chown​(String path,
                                String user,
                                String group)
        Change the ownership on the file represented by path to user and {code group}, asynchronously.
        Parameters:
        path - the path to the file
        user - the user name, null will not change the user name
        group - the user group, null will not change the user group name
        Returns:
        a reference to this, so the API can be used fluently
      • rxChown

        public io.reactivex.Completable rxChown​(String path,
                                                String user,
                                                String group)
        Change the ownership on the file represented by path to user and {code group}, asynchronously.
        Parameters:
        path - the path to the file
        user - the user name, null will not change the user name
        group - the user group, null will not change the user group name
        Returns:
        a reference to this, so the API can be used fluently
      • props

        public FileSystem props​(String path,
                                Handler<AsyncResult<FileProps>> handler)
        Obtain properties for the file represented by path, asynchronously.

        If the file is a link, the link will be followed.

        Parameters:
        path - the path to the file
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • props

        public FileSystem props​(String path)
        Obtain properties for the file represented by path, asynchronously.

        If the file is a link, the link will be followed.

        Parameters:
        path - the path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • rxProps

        public io.reactivex.Single<FileProps> rxProps​(String path)
        Obtain properties for the file represented by path, asynchronously.

        If the file is a link, the link will be followed.

        Parameters:
        path - the path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • lprops

        public FileSystem lprops​(String path,
                                 Handler<AsyncResult<FileProps>> handler)
        Obtain properties for the link represented by path, asynchronously.

        The link will not be followed.

        Parameters:
        path - the path to the file
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • lprops

        public FileSystem lprops​(String path)
        Obtain properties for the link represented by path, asynchronously.

        The link will not be followed.

        Parameters:
        path - the path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • rxLprops

        public io.reactivex.Single<FileProps> rxLprops​(String path)
        Obtain properties for the link represented by path, asynchronously.

        The link will not be followed.

        Parameters:
        path - the path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • link

        public FileSystem link​(String link,
                               String existing,
                               Handler<AsyncResult<Void>> handler)
        Create a hard link on the file system from link to existing, asynchronously.
        Parameters:
        link - the link
        existing - the link destination
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • link

        public FileSystem link​(String link,
                               String existing)
        Create a hard link on the file system from link to existing, asynchronously.
        Parameters:
        link - the link
        existing - the link destination
        Returns:
        a reference to this, so the API can be used fluently
      • rxLink

        public io.reactivex.Completable rxLink​(String link,
                                               String existing)
        Create a hard link on the file system from link to existing, asynchronously.
        Parameters:
        link - the link
        existing - the link destination
        Returns:
        a reference to this, so the API can be used fluently
      • symlink

        public FileSystem symlink​(String link,
                                  String existing,
                                  Handler<AsyncResult<Void>> handler)
        Create a symbolic link on the file system from link to existing, asynchronously.
        Parameters:
        link - the link
        existing - the link destination
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • symlink

        public FileSystem symlink​(String link,
                                  String existing)
        Create a symbolic link on the file system from link to existing, asynchronously.
        Parameters:
        link - the link
        existing - the link destination
        Returns:
        a reference to this, so the API can be used fluently
      • rxSymlink

        public io.reactivex.Completable rxSymlink​(String link,
                                                  String existing)
        Create a symbolic link on the file system from link to existing, asynchronously.
        Parameters:
        link - the link
        existing - the link destination
        Returns:
        a reference to this, so the API can be used fluently
      • unlink

        public FileSystem unlink​(String link,
                                 Handler<AsyncResult<Void>> handler)
        Unlinks the link on the file system represented by the path link, asynchronously.
        Parameters:
        link - the link
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • unlink

        public FileSystem unlink​(String link)
        Unlinks the link on the file system represented by the path link, asynchronously.
        Parameters:
        link - the link
        Returns:
        a reference to this, so the API can be used fluently
      • rxUnlink

        public io.reactivex.Completable rxUnlink​(String link)
        Unlinks the link on the file system represented by the path link, asynchronously.
        Parameters:
        link - the link
        Returns:
        a reference to this, so the API can be used fluently
      • readSymlink

        public FileSystem readSymlink​(String link,
                                      Handler<AsyncResult<String>> handler)
        Returns the path representing the file that the symbolic link specified by link points to, asynchronously.
        Parameters:
        link - the link
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • readSymlink

        public FileSystem readSymlink​(String link)
        Returns the path representing the file that the symbolic link specified by link points to, asynchronously.
        Parameters:
        link - the link
        Returns:
        a reference to this, so the API can be used fluently
      • rxReadSymlink

        public io.reactivex.Single<String> rxReadSymlink​(String link)
        Returns the path representing the file that the symbolic link specified by link points to, asynchronously.
        Parameters:
        link - the link
        Returns:
        a reference to this, so the API can be used fluently
      • delete

        public FileSystem delete​(String path,
                                 Handler<AsyncResult<Void>> handler)
        Deletes the file represented by the specified path, asynchronously.
        Parameters:
        path - path to the file
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • delete

        public FileSystem delete​(String path)
        Deletes the file represented by the specified path, asynchronously.
        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • rxDelete

        public io.reactivex.Completable rxDelete​(String path)
        Deletes the file represented by the specified path, asynchronously.
        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • deleteRecursive

        public FileSystem deleteRecursive​(String path,
                                          boolean recursive,
                                          Handler<AsyncResult<Void>> handler)
        Deletes the file represented by the specified path, asynchronously.

        If the path represents a directory and recursive = true then the directory and its contents will be deleted recursively.

        Parameters:
        path - path to the file
        recursive - delete recursively?
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • deleteRecursive

        public FileSystem deleteRecursive​(String path,
                                          boolean recursive)
        Deletes the file represented by the specified path, asynchronously.

        If the path represents a directory and recursive = true then the directory and its contents will be deleted recursively.

        Parameters:
        path - path to the file
        recursive - delete recursively?
        Returns:
        a reference to this, so the API can be used fluently
      • rxDeleteRecursive

        public io.reactivex.Completable rxDeleteRecursive​(String path,
                                                          boolean recursive)
        Deletes the file represented by the specified path, asynchronously.

        If the path represents a directory and recursive = true then the directory and its contents will be deleted recursively.

        Parameters:
        path - path to the file
        recursive - delete recursively?
        Returns:
        a reference to this, so the API can be used fluently
      • mkdir

        public FileSystem mkdir​(String path,
                                Handler<AsyncResult<Void>> handler)
        Create the directory represented by path, asynchronously.

        The operation will fail if the directory already exists.

        Parameters:
        path - path to the file
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • mkdir

        public FileSystem mkdir​(String path)
        Create the directory represented by path, asynchronously.

        The operation will fail if the directory already exists.

        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • rxMkdir

        public io.reactivex.Completable rxMkdir​(String path)
        Create the directory represented by path, asynchronously.

        The operation will fail if the directory already exists.

        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • mkdir

        public FileSystem mkdir​(String path,
                                String perms,
                                Handler<AsyncResult<Void>> handler)
        Create the directory represented by path, 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 file
        perms - the permissions string
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • mkdir

        public FileSystem mkdir​(String path,
                                String perms)
        Create the directory represented by path, 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 file
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • rxMkdir

        public io.reactivex.Completable rxMkdir​(String path,
                                                String perms)
        Create the directory represented by path, 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 file
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • mkdirs

        public FileSystem mkdirs​(String path,
                                 Handler<AsyncResult<Void>> handler)
        Create the directory represented by path and any non existent parents, asynchronously.

        The operation will fail if the path already exists but is not a directory.

        Parameters:
        path - path to the file
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • mkdirs

        public FileSystem mkdirs​(String path)
        Create the directory represented by path and any non existent parents, asynchronously.

        The operation will fail if the path already exists but is not a directory.

        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • rxMkdirs

        public io.reactivex.Completable rxMkdirs​(String path)
        Create the directory represented by path and any non existent parents, asynchronously.

        The operation will fail if the path already exists but is not a directory.

        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • mkdirs

        public FileSystem mkdirs​(String path,
                                 String perms,
                                 Handler<AsyncResult<Void>> handler)
        Create the directory represented by path and 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 path already exists but is not a directory.

        Parameters:
        path - path to the file
        perms - the permissions string
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • mkdirs

        public FileSystem mkdirs​(String path,
                                 String perms)
        Create the directory represented by path and 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 path already exists but is not a directory.

        Parameters:
        path - path to the file
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • rxMkdirs

        public io.reactivex.Completable rxMkdirs​(String path,
                                                 String perms)
        Create the directory represented by path and 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 path already exists but is not a directory.

        Parameters:
        path - path to the file
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • readDir

        public FileSystem readDir​(String path,
                                  Handler<AsyncResult<List<String>>> handler)
        Read the contents of the directory specified by path, asynchronously.

        The result is an array of String representing the paths of the files inside the directory.

        Parameters:
        path - path to the file
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • readDir

        public FileSystem readDir​(String path)
        Read the contents of the directory specified by path, 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 reference to this, so the API can be used fluently
      • rxReadDir

        public io.reactivex.Single<List<String>> rxReadDir​(String path)
        Read the contents of the directory specified by path, 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 reference to this, so the API can be used fluently
      • readDir

        public FileSystem readDir​(String path,
                                  String filter,
                                  Handler<AsyncResult<List<String>>> handler)
        Read the contents of the directory specified by path, asynchronously.

        The parameter filter is a regular expression. If filter is 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 directory
        filter - the filter expression
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • readDir

        public FileSystem readDir​(String path,
                                  String filter)
        Read the contents of the directory specified by path, asynchronously.

        The parameter filter is a regular expression. If filter is 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 directory
        filter - the filter expression
        Returns:
        a reference to this, so the API can be used fluently
      • rxReadDir

        public io.reactivex.Single<List<String>> rxReadDir​(String path,
                                                           String filter)
        Read the contents of the directory specified by path, asynchronously.

        The parameter filter is a regular expression. If filter is 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 directory
        filter - the filter expression
        Returns:
        a reference to this, so the API can be used fluently
      • readFile

        public FileSystem readFile​(String path,
                                   Handler<AsyncResult<Buffer>> handler)
        Reads the entire file as represented by the path path as 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
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • readFile

        public FileSystem readFile​(String path)
        Reads the entire file as represented by the path path as 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 reference to this, so the API can be used fluently
      • rxReadFile

        public io.reactivex.Single<Buffer> rxReadFile​(String path)
        Reads the entire file as represented by the path path as 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 reference to this, so the API can be used fluently
      • writeFile

        public FileSystem writeFile​(String path,
                                    Buffer data,
                                    Handler<AsyncResult<Void>> handler)
        Creates the file, and writes the specified Buffer data to the file represented by the path path, asynchronously.
        Parameters:
        path - path to the file
        data -
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • writeFile

        public FileSystem writeFile​(String path,
                                    Buffer data)
        Creates the file, and writes the specified Buffer data to the file represented by the path path, asynchronously.
        Parameters:
        path - path to the file
        data -
        Returns:
        a reference to this, so the API can be used fluently
      • rxWriteFile

        public io.reactivex.Completable rxWriteFile​(String path,
                                                    Buffer data)
        Creates the file, and writes the specified Buffer data to the file represented by the path path, asynchronously.
        Parameters:
        path - path to the file
        data -
        Returns:
        a reference to this, so the API can be used fluently
      • open

        public FileSystem open​(String path,
                               OpenOptions options,
                               Handler<AsyncResult<AsyncFile>> handler)
        Open the file represented by path, 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 file
        options - options describing how the file should be opened
        handler -
        Returns:
        a reference to this, so the API can be used fluently
      • open

        public FileSystem open​(String path,
                               OpenOptions options)
        Open the file represented by path, 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 file
        options - options describing how the file should be opened
        Returns:
        a reference to this, so the API can be used fluently
      • rxOpen

        public io.reactivex.Single<AsyncFile> rxOpen​(String path,
                                                     OpenOptions options)
        Open the file represented by path, 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 file
        options - options describing how the file should be opened
        Returns:
        a reference to this, so the API can be used fluently
      • createFile

        public FileSystem createFile​(String path,
                                     Handler<AsyncResult<Void>> handler)
        Creates an empty file with the specified path, asynchronously.
        Parameters:
        path - path to the file
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • createFile

        public FileSystem createFile​(String path)
        Creates an empty file with the specified path, asynchronously.
        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • rxCreateFile

        public io.reactivex.Completable rxCreateFile​(String path)
        Creates an empty file with the specified path, asynchronously.
        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • createFile

        public FileSystem createFile​(String path,
                                     String perms,
                                     Handler<AsyncResult<Void>> handler)
        Creates an empty file with the specified path and permissions perms, asynchronously.
        Parameters:
        path - path to the file
        perms - the permissions string
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • createFile

        public FileSystem createFile​(String path,
                                     String perms)
        Creates an empty file with the specified path and permissions perms, asynchronously.
        Parameters:
        path - path to the file
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • rxCreateFile

        public io.reactivex.Completable rxCreateFile​(String path,
                                                     String perms)
        Creates an empty file with the specified path and permissions perms, asynchronously.
        Parameters:
        path - path to the file
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • exists

        public FileSystem exists​(String path,
                                 Handler<AsyncResult<Boolean>> handler)
        Determines whether the file as specified by the path path exists, asynchronously.
        Parameters:
        path - path to the file
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • exists

        public FileSystem exists​(String path)
        Determines whether the file as specified by the path path exists, asynchronously.
        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • rxExists

        public io.reactivex.Single<Boolean> rxExists​(String path)
        Determines whether the file as specified by the path path exists, asynchronously.
        Parameters:
        path - path to the file
        Returns:
        a reference to this, so the API can be used fluently
      • fsProps

        public FileSystem fsProps​(String path,
                                  Handler<AsyncResult<FileSystemProps>> handler)
        Returns properties of the file-system being used by the specified path, asynchronously.
        Parameters:
        path - path to anywhere on the filesystem
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • fsProps

        public FileSystem fsProps​(String path)
        Returns properties of the file-system being used by the specified path, asynchronously.
        Parameters:
        path - path to anywhere on the filesystem
        Returns:
        a reference to this, so the API can be used fluently
      • rxFsProps

        public io.reactivex.Single<FileSystemProps> rxFsProps​(String path)
        Returns properties of the file-system being used by the specified path, asynchronously.
        Parameters:
        path - path to anywhere on the filesystem
        Returns:
        a reference to this, so the API can be used fluently
      • createTempDirectory

        public FileSystem createTempDirectory​(String prefix,
                                              Handler<AsyncResult<String>> handler)
        Creates a new directory in the default temporary-file directory, using the given prefix to generate its name, asynchronously.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • createTempDirectory

        public FileSystem 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.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        Returns:
        a reference to this, so the API can be used fluently
      • rxCreateTempDirectory

        public io.reactivex.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.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        Returns:
        a reference to this, so the API can be used fluently
      • createTempDirectory

        public FileSystem createTempDirectory​(String prefix,
                                              String perms,
                                              Handler<AsyncResult<String>> handler)
        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 perms.

        The permission String takes the form rwxr-x--- as specified in here.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        perms - the permissions string
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • createTempDirectory

        public FileSystem 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 perms.

        The permission String takes the form rwxr-x--- as specified in here.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • rxCreateTempDirectory

        public io.reactivex.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 perms.

        The permission String takes the form rwxr-x--- as specified in here.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • createTempDirectory

        public FileSystem createTempDirectory​(String dir,
                                              String prefix,
                                              String perms,
                                              Handler<AsyncResult<String>> handler)
        Creates a new directory in the directory provided by the path path, using the given prefix to generate its name, 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.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        dir - the path to directory in which to create the directory
        prefix - the prefix string to be used in generating the directory's name; may be null
        perms - the permissions string
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • createTempDirectory

        public FileSystem createTempDirectory​(String dir,
                                              String prefix,
                                              String perms)
        Creates a new directory in the directory provided by the path path, using the given prefix to generate its name, 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.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        dir - the path to directory in which to create the directory
        prefix - the prefix string to be used in generating the directory's name; may be null
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • rxCreateTempDirectory

        public io.reactivex.Single<String> rxCreateTempDirectory​(String dir,
                                                                 String prefix,
                                                                 String perms)
        Creates a new directory in the directory provided by the path path, using the given prefix to generate its name, 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.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        dir - the path to directory in which to create the directory
        prefix - the prefix string to be used in generating the directory's name; may be null
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • createTempFile

        public FileSystem createTempFile​(String prefix,
                                         String suffix,
                                         Handler<AsyncResult<String>> handler)
        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.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • createTempFile

        public FileSystem 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.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        Returns:
        a reference to this, so the API can be used fluently
      • rxCreateTempFile

        public io.reactivex.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.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        Returns:
        a reference to this, so the API can be used fluently
      • createTempFile

        public FileSystem createTempFile​(String prefix,
                                         String suffix,
                                         String perms,
                                         Handler<AsyncResult<String>> handler)
        Creates a new file in the directory provided by the path dir, using the given prefix and suffix to generate its name, asynchronously.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        perms -
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • createTempFile

        public FileSystem createTempFile​(String prefix,
                                         String suffix,
                                         String perms)
        Creates a new file in the directory provided by the path dir, using the given prefix and suffix to generate its name, asynchronously.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        perms -
        Returns:
        a reference to this, so the API can be used fluently
      • rxCreateTempFile

        public io.reactivex.Single<String> rxCreateTempFile​(String prefix,
                                                            String suffix,
                                                            String perms)
        Creates a new file in the directory provided by the path dir, using the given prefix and suffix to generate its name, asynchronously.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        perms -
        Returns:
        a reference to this, so the API can be used fluently
      • createTempFile

        public FileSystem createTempFile​(String dir,
                                         String prefix,
                                         String suffix,
                                         String perms,
                                         Handler<AsyncResult<String>> handler)
        Creates a new file in the directory provided by the path dir, using the given prefix and suffix to generate its name, 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.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        dir - the path to directory in which to create the directory
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        perms - the permissions string
        handler - the handler that will be called on completion
        Returns:
        a reference to this, so the API can be used fluently
      • createTempFile

        public FileSystem createTempFile​(String dir,
                                         String prefix,
                                         String suffix,
                                         String perms)
        Creates a new file in the directory provided by the path dir, using the given prefix and suffix to generate its name, 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.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        dir - the path to directory in which to create the directory
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently
      • rxCreateTempFile

        public io.reactivex.Single<String> rxCreateTempFile​(String dir,
                                                            String prefix,
                                                            String suffix,
                                                            String perms)
        Creates a new file in the directory provided by the path dir, using the given prefix and suffix to generate its name, 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.

        As with the File.createTempFile methods, this method is only part of a temporary-file facility.A Runtime, or the File mechanism may be used to delete the directory automatically.

        Parameters:
        dir - the path to directory in which to create the directory
        prefix - the prefix string to be used in generating the directory's name; may be null
        suffix - the suffix string to be used in generating the file's name; may be null, in which case ".tmp" is used
        perms - the permissions string
        Returns:
        a reference to this, so the API can be used fluently