org.vertx.scala.core.file

FileSystem

final class FileSystem extends Self

Contains a broad set of operations for manipulating files.

An asynchronous and a synchronous version of each operation is provided.

The asynchronous versions take a handler which is called when the operation completes or an error occurs.

The synchronous versions return the results, or throw exceptions directly.

It is highly recommended the asynchronous versions are used unless you are sure the operation will not block for a significant period of time.

Instances of FileSystem are thread-safe.

Linear Supertypes
Self, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FileSystem
  2. Self
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

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. val asJava: java.core.file.FileSystem

  6. def chmod(path: String, perms: String, dirPerms: String, handler: (AsyncResult[Void]) ⇒ 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.

  7. def chmod(path: String, perms: String, handler: (AsyncResult[Void]) ⇒ 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.

  8. def chmodSync(path: String, perms: String, dirPerms: String): FileSystem

    Synchronous version of String, String, Handler)

  9. def chmodSync(path: String, perms: String): FileSystem

    Synchronous version of String, Handler)

  10. def chown(path: String, user: Option[String], group: Option[String], handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

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

  11. def chownSync(path: String, user: Option[String], group: Option[String]): FileSystem

    Synchronous version of Option[String], Option[String], AsyncResult[Void] => Unit).

  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def copy(from: String, to: String, recursive: Boolean, handler: (AsyncResult[Void]) ⇒ 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.

  14. def copy(from: String, to: String, handler: (AsyncResult[Void]) ⇒ 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.

  15. def copySync(from: String, to: String, recursive: Boolean): FileSystem

    Synchronous version of String, boolean, Handler)

  16. def copySync(from: String, to: String): FileSystem

    Synchronous version of String, Handler)

  17. def createFile(path: String, perms: String, handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

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

  18. def createFile(path: String, handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

    Creates an empty file with the specified path, asynchronously.

  19. def createFileSync(path: String, perms: String): FileSystem

    Synchronous version of String, Handler)

  20. def createFileSync(path: String): FileSystem

    Synchronous version of Handler)

  21. def delete(path: String, recursive: Boolean, handler: (AsyncResult[Void]) ⇒ 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.

  22. def delete(path: String, handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

    Deletes the file represented by the specified path, asynchronously.

  23. def deleteSync(path: String, recursive: Boolean): FileSystem

    Synchronous version of boolean, Handler)

  24. def deleteSync(path: String): FileSystem

    Synchronous version of Handler)

  25. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  27. def exists(path: String, handler: (AsyncResult[Boolean]) ⇒ Unit): FileSystem

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

  28. def existsSync(path: String): Boolean

    Synchronous version of Handler)

  29. def finalize(): Unit

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

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

  31. def fsPropsSync(path: String): FileSystemProps

    Synchronous version of Handler)

  32. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  33. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  34. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  35. def link(link: String, existing: String, handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

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

  36. def linkSync(link: String, existing: String): FileSystem

    Synchronous version of String, Handler)

  37. def lprops(path: String, handler: (AsyncResult[FileProps]) ⇒ Unit): 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.

  38. def lpropsSync(path: String): FileProps

    Synchronous version of Handler)

  39. def mkdir(path: String, perms: String, createParents: Boolean, handler: (AsyncResult[Void]) ⇒ 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.

    If createParents is set to true then any non-existent parent directories of the directory will also be created.

    The operation will fail if the directory already exists.

  40. def mkdir(path: String, perms: String, handler: (AsyncResult[Void]) ⇒ 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.

  41. def mkdir(path: String, createParents: Boolean, handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

    Create the directory represented by path, asynchronously.

    Create the directory represented by path, asynchronously.

    If createParents is set to true then any non-existent parent directories of the directory will also be created.

    The operation will fail if the directory already exists.

  42. def mkdir(path: String, handler: (AsyncResult[Void]) ⇒ 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.

  43. def mkdirSync(path: String, perms: String, createParents: Boolean): FileSystem

    Synchronous version of String, boolean, Handler)

  44. def mkdirSync(path: String, perms: String): FileSystem

    Synchronous version of String, Handler)

  45. def mkdirSync(path: String, createParents: Boolean): FileSystem

    Synchronous version of boolean, Handler)

  46. def mkdirSync(path: String): FileSystem

    Synchronous version of Handler)

  47. def move(from: String, to: String, handler: (AsyncResult[Void]) ⇒ 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.

  48. def moveSync(from: String, to: String): FileSystem

    Synchronous version of String, Handler)

  49. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  50. final def notify(): Unit

    Definition Classes
    AnyRef
  51. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  52. def open(path: String, perms: String, read: Boolean, write: Boolean, createNew: Boolean, flush: Boolean, handler: (AsyncResult[AsyncFile]) ⇒ Unit): FileSystem

    Open the file represented by path, asynchronously.

    Open the file represented by path, asynchronously.

    If read is true the file will be opened for reading. If write is true the file will be opened for writing.

    If the file does not already exist and createNew is true it will be created with the permissions as specified by perms, otherwise the operation will fail.

    If flush is true then all writes will be automatically flushed through OS buffers to the underlying storage on each write.

  53. def open(path: String, perms: String, read: Boolean, write: Boolean, createNew: Boolean, handler: (AsyncResult[AsyncFile]) ⇒ Unit): FileSystem

    Open the file represented by path, asynchronously.

    Open the file represented by path, asynchronously.

    If read is true the file will be opened for reading. If write is true the file will be opened for writing.

    If the file does not already exist and createNew is true it will be created with the permissions as specified by perms, otherwise the operation will fail.

    Write operations will not automatically flush to storage.

  54. def open(path: String, perms: String, createNew: Boolean, handler: (AsyncResult[AsyncFile]) ⇒ Unit): 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 and createNew is true it will be created with the permissions as specified by perms, otherwise the operation will fail. Write operations will not automatically flush to storage.

  55. def open(path: String, perms: String, handler: (AsyncResult[AsyncFile]) ⇒ Unit): 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 with the permissions as specified by perms. Write operations will not automatically flush to storage.

  56. def open(path: String, handler: (AsyncResult[AsyncFile]) ⇒ Unit): 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. Write operations will not automatically flush to storage.

  57. def openSync(path: String, perms: String, read: Boolean, write: Boolean, createNew: Boolean, flush: Boolean): AsyncFile

    Synchronous version of String, boolean, boolean, boolean, boolean, Handler)

  58. def openSync(path: String, perms: String, read: Boolean, write: Boolean, createNew: Boolean): AsyncFile

    Synchronous version of String, boolean, boolean, boolean, Handler)

  59. def openSync(path: String, perms: String, createNew: Boolean): AsyncFile

    Synchronous version of String, boolean, Handler)

  60. def openSync(path: String, perms: String): AsyncFile

    Synchronous version of String, Handler)

  61. def openSync(path: String): AsyncFile

    Synchronous version of Handler)

  62. def props(path: String, handler: (AsyncResult[FileProps]) ⇒ Unit): 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.

  63. def propsSync(path: String): FileProps

    Synchronous version of Handler)

  64. def readDir(path: String, filter: String, handler: (AsyncResult[Array[String]]) ⇒ Unit): 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 @{filter}will be returned.

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

  65. def readDir(path: String, handler: (AsyncResult[Array[String]]) ⇒ Unit): 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.

  66. def readDirSync(path: String, filter: String): Array[String]

    Synchronous version of String, Handler)

  67. def readDirSync(path: String): Array[String]

    Synchronous version of Handler)

  68. def readFile(path: String, handler: (AsyncResult[Buffer]) ⇒ Unit): FileSystem

    Reads the entire file as represented by the path path as a org.vertx.scala.core.buffer.Buffer, asynchronously.

    Reads the entire file as represented by the path path as a org.vertx.scala.core.buffer.Buffer, asynchronously.

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

  69. def readFileSync(path: String): Buffer

    Synchronous version of Handler)

  70. def readSymlink(link: String, handler: (AsyncResult[String]) ⇒ Unit): FileSystem

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

  71. def readSymlinkSync(link: String): String

    Synchronous version of Handler)

  72. def symlink(link: String, existing: String, handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

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

  73. def symlinkSync(link: String, existing: String): FileSystem

    Synchronous version of String, Handler)

  74. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  75. def toString(): String

    Definition Classes
    AnyRef → Any
  76. def truncate(path: String, len: Long, handler: (AsyncResult[Void]) ⇒ 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.

  77. def truncateSync(path: String, len: Long): FileSystem

    Synchronous version of long, Handler)

  78. def unlink(link: String, handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

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

  79. def unlinkSync(link: String): FileSystem

    Synchronous version of Handler)

  80. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  81. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  82. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  83. def wrap[X](doStuff: ⇒ X): FileSystem.this.type

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Attributes
    protected[this]
    Definition Classes
    Self
  84. def writeFile(path: String, data: Buffer, handler: (AsyncResult[Void]) ⇒ Unit): FileSystem

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

  85. def writeFileSync(path: String, data: Buffer): FileSystem

    Synchronous version of Buffer, Handler)

Inherited from Self

Inherited from AnyRef

Inherited from Any

Ungrouped