Packages

class FileSystem extends AnyRef

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FileSystem
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FileSystem(_asJava: AnyRef)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: AnyRef
  6. def chmod(path: String, perms: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Change the permissions on the file represented by path to perms, asynchronously.

    Change the permissions on the file represented by path to perms, asynchronously.

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

    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

  7. def chmodBlocking(path: String, perms: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem

  8. def chmodFuture(path: String, perms: String): scala.concurrent.Future[Unit]

    Like chmod but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  9. def chmodRecursive(path: String, perms: String, dirPerms: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Change the permissions on the file represented by path to perms, asynchronously.

    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.

    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

  10. def chmodRecursiveBlocking(path: String, perms: String, dirPerms: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#chmodRecursiveFuture

  11. def chmodRecursiveFuture(path: String, perms: String, dirPerms: String): scala.concurrent.Future[Unit]

    Like chmodRecursive but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  12. def chown(path: String, user: Option[String], group: Option[String], handler: Handler[AsyncResult[Unit]]): FileSystem

    Change the ownership on the file represented by path to user and {code group, asynchronously.

    Change the ownership on the file represented by path to user and {code group, asynchronously.

    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

  13. def chownBlocking(path: String, user: Option[String], group: Option[String]): FileSystem

    Blocking version of

  14. def chownFuture(path: String, user: Option[String], group: Option[String]): scala.concurrent.Future[Unit]

    Like chown but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  15. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def copy(from: String, to: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Copy a file from the path from to path to, asynchronously.

    Copy a file from the path from to path to, asynchronously.

    The copy will fail if the destination already exists.

    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

  17. def copyBlocking(from: String, to: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#copyFuture

  18. def copyFuture(from: String, to: String): scala.concurrent.Future[Unit]

    Like copy but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  19. def copyRecursive(from: String, to: String, recursive: Boolean, handler: Handler[AsyncResult[Unit]]): FileSystem

    Copy a file from the path from to path to, asynchronously.

    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.

    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

  20. def copyRecursiveBlocking(from: String, to: String, recursive: Boolean): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#copyRecursiveFuture

  21. def copyRecursiveFuture(from: String, to: String, recursive: Boolean): scala.concurrent.Future[Unit]

    Like copyRecursive but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  22. def createFile(path: String, perms: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Creates an empty file with the specified path and permissions perms, asynchronously.

    Creates an empty file with the specified path and permissions perms, asynchronously.

    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

  23. def createFile(path: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Creates an empty file with the specified path, asynchronously.

    Creates an empty file with the specified path, asynchronously.

    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

  24. def createFileBlocking(path: String, perms: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#createFileFuture

  25. def createFileBlocking(path: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#createFileFuture

  26. def createFileFuture(path: String, perms: String): scala.concurrent.Future[Unit]

    Like createFile but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  27. def createFileFuture(path: String): scala.concurrent.Future[Unit]

    Like createFile but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  28. def delete(path: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Deletes the file represented by the specified path, asynchronously.

    Deletes the file represented by the specified path, asynchronously.

    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

  29. def deleteBlocking(path: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#deleteFuture

  30. def deleteFuture(path: String): scala.concurrent.Future[Unit]

    Like delete but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  31. def deleteRecursive(path: String, recursive: Boolean, handler: Handler[AsyncResult[Unit]]): FileSystem

    Deletes the file represented by the specified path, asynchronously.

    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.

    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

  32. def deleteRecursiveBlocking(path: String, recursive: Boolean): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#deleteRecursiveFuture

  33. def deleteRecursiveFuture(path: String, recursive: Boolean): scala.concurrent.Future[Unit]

    Like deleteRecursive but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  34. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  36. def exists(path: String, handler: Handler[AsyncResult[Boolean]]): FileSystem

    Determines whether the file as specified by the path path exists, asynchronously.

    Determines whether the file as specified by the path path exists, asynchronously.

    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

  37. def existsBlocking(path: String): Boolean

    Blocking version of io.vertx.scala.core.file.FileSystem#existsFuture

  38. def existsFuture(path: String): scala.concurrent.Future[Boolean]

    Like exists but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  39. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  40. def fsProps(path: String, handler: Handler[AsyncResult[FileSystemProps]]): FileSystem

    Returns properties of the file-system being used by the specified path, asynchronously.

    Returns properties of the file-system being used by the specified path, asynchronously.

    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

  41. def fsPropsBlocking(path: String): FileSystemProps

    Blocking version of io.vertx.scala.core.file.FileSystem#fsPropsFuture

  42. def fsPropsFuture(path: String): scala.concurrent.Future[FileSystemProps]

    Like fsProps but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  43. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  44. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  45. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  46. def link(link: String, existing: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Create a hard link on the file system from link to existing, asynchronously.

    Create a hard link on the file system from link to existing, asynchronously.

    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

  47. def linkBlocking(link: String, existing: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#linkFuture

  48. def linkFuture(link: String, existing: String): scala.concurrent.Future[Unit]

    Like link but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  49. def lprops(path: String, handler: Handler[AsyncResult[FileProps]]): FileSystem

    Obtain properties for the link represented by path, asynchronously.

    Obtain properties for the link represented by path, asynchronously.

    The link will not be followed.

    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

  50. def lpropsBlocking(path: String): FileProps

    Blocking version of io.vertx.scala.core.file.FileSystem#lpropsFuture

  51. def lpropsFuture(path: String): scala.concurrent.Future[FileProps]

    Like lprops but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  52. def mkdir(path: String, perms: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Create the directory represented by path, asynchronously.

    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.

    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

  53. def mkdir(path: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Create the directory represented by path, asynchronously.

    Create the directory represented by path, asynchronously.

    The operation will fail if the directory already exists.

    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

  54. def mkdirBlocking(path: String, perms: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#mkdirFuture

  55. def mkdirBlocking(path: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#mkdirFuture

  56. def mkdirFuture(path: String, perms: String): scala.concurrent.Future[Unit]

    Like mkdir but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  57. def mkdirFuture(path: String): scala.concurrent.Future[Unit]

    Like mkdir but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  58. def mkdirs(path: String, perms: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Create the directory represented by path and any non existent parents, asynchronously.

    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 directory already exists.

    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

  59. def mkdirs(path: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Create the directory represented by path and any non existent parents, asynchronously.

    Create the directory represented by path and any non existent parents, asynchronously.

    The operation will fail if the directory already exists.

    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

  60. def mkdirsBlocking(path: String, perms: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#mkdirsFuture

  61. def mkdirsBlocking(path: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#mkdirsFuture

  62. def mkdirsFuture(path: String, perms: String): scala.concurrent.Future[Unit]

    Like mkdirs but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  63. def mkdirsFuture(path: String): scala.concurrent.Future[Unit]

    Like mkdirs but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  64. def move(from: String, to: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Move a file from the path from to path to, asynchronously.

    Move a file from the path from to path to, asynchronously.

    The move will fail if the destination already exists.

    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

  65. def moveBlocking(from: String, to: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#moveFuture

  66. def moveFuture(from: String, to: String): scala.concurrent.Future[Unit]

    Like move but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  67. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  68. final def notify(): Unit
    Definition Classes
    AnyRef
  69. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  70. def open(path: String, options: OpenOptions, handler: Handler[AsyncResult[AsyncFile]]): FileSystem

    Open the file represented by path, asynchronously.

    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.

    path

    path to the file

    options

    options describing how the file should be openedsee OpenOptions

    returns

    a reference to this, so the API can be used fluently

  71. def openBlocking(path: String, options: OpenOptions): AsyncFile

    Blocking version of io.vertx.scala.core.file.FileSystem#openFuture

  72. def openFuture(path: String, options: OpenOptions): scala.concurrent.Future[AsyncFile]

    Like open but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  73. def props(path: String, handler: Handler[AsyncResult[FileProps]]): FileSystem

    Obtain properties for the file represented by path, asynchronously.

    Obtain properties for the file represented by path, asynchronously.

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

    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

  74. def propsBlocking(path: String): FileProps

    Blocking version of io.vertx.scala.core.file.FileSystem#propsFuture

  75. def propsFuture(path: String): scala.concurrent.Future[FileProps]

    Like props but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  76. def readDir(path: String, filter: String, handler: Handler[AsyncResult[Buffer[String]]]): FileSystem

    Read the contents of the directory specified by path, asynchronously.

    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 @{filterwill be returned.

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

    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

  77. def readDir(path: String, handler: Handler[AsyncResult[Buffer[String]]]): FileSystem

    Read the contents of the directory specified by path, asynchronously.

    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.

    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

  78. def readDirBlocking(path: String, filter: String): Buffer[String]

    Blocking version of io.vertx.scala.core.file.FileSystem#readDirFuture

  79. def readDirBlocking(path: String): Buffer[String]

    Blocking version of io.vertx.scala.core.file.FileSystem#readDirFuture

  80. def readDirFuture(path: String, filter: String): scala.concurrent.Future[Buffer[String]]

    Like readDir but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  81. def readDirFuture(path: String): scala.concurrent.Future[Buffer[String]]

    Like readDir but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  82. def readFile(path: String, handler: Handler[AsyncResult[Buffer]]): FileSystem

    Reads the entire file as represented by the path path as a , asynchronously.

    Reads the entire file as represented by the path path as a , asynchronously.

    Do not user this method to read very large files or you risk running out of available RAM.

    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

  83. def readFileBlocking(path: String): Buffer

    Blocking version of io.vertx.scala.core.file.FileSystem#readFileFuture

  84. def readFileFuture(path: String): scala.concurrent.Future[Buffer]

    Like readFile but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  85. def readSymlink(link: String, handler: Handler[AsyncResult[String]]): FileSystem

    Returns the path representing the file that the symbolic link specified by link points to, asynchronously.

    Returns the path representing the file that the symbolic link specified by link points to, asynchronously.

    link

    the link

    handler

    the handler that will be called on completion

    returns

    a reference to this, so the API can be used fluently

  86. def readSymlinkBlocking(link: String): String

    Blocking version of io.vertx.scala.core.file.FileSystem#readSymlinkFuture

  87. def readSymlinkFuture(link: String): scala.concurrent.Future[String]

    Like readSymlink but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  88. def symlink(link: String, existing: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Create a symbolic link on the file system from link to existing, asynchronously.

    Create a symbolic link on the file system from link to existing, asynchronously.

    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

  89. def symlinkBlocking(link: String, existing: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#linkFuture

  90. def symlinkFuture(link: String, existing: String): scala.concurrent.Future[Unit]

    Like symlink but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  91. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  92. def toString(): String
    Definition Classes
    AnyRef → Any
  93. def truncate(path: String, len: Long, handler: Handler[AsyncResult[Unit]]): FileSystem

    Truncate the file represented by path to length len in bytes, asynchronously.

    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.

    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

  94. def truncateBlocking(path: String, len: Long): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#truncateFuture

  95. def truncateFuture(path: String, len: Long): scala.concurrent.Future[Unit]

    Like truncate but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  96. def unlink(link: String, handler: Handler[AsyncResult[Unit]]): FileSystem

    Unlinks the link on the file system represented by the path link, asynchronously.

    Unlinks the link on the file system represented by the path link, asynchronously.

    link

    the link

    handler

    the handler that will be called on completion

    returns

    a reference to this, so the API can be used fluently

  97. def unlinkBlocking(link: String): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#unlinkFuture

  98. def unlinkFuture(link: String): scala.concurrent.Future[Unit]

    Like unlink but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  99. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  100. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  101. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  102. def writeFile(path: String, data: Buffer, handler: Handler[AsyncResult[Unit]]): FileSystem

    Creates the file, and writes the specified Buffer data to the file represented by the path path, asynchronously.

    Creates the file, and writes the specified Buffer data to the file represented by the path path, asynchronously.

    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

  103. def writeFileBlocking(path: String, data: Buffer): FileSystem

    Blocking version of io.vertx.scala.core.file.FileSystem#writeFileFuture

  104. def writeFileFuture(path: String, data: Buffer): scala.concurrent.Future[Unit]

    Like writeFile but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

Inherited from AnyRef

Inherited from Any

Ungrouped