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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. val asJava: java.core.file.FileSystem

  8. 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.

  9. 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.

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

    Synchronous version of String, String, Handler)

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

    Synchronous version of String, Handler)

  12. 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.

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

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

  14. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. 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.

  16. 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.

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

    Synchronous version of String, boolean, Handler)

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

    Synchronous version of String, Handler)

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

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

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

    Creates an empty file with the specified path, asynchronously.

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

    Synchronous version of String, Handler)

  22. def createFileSync(path: String): FileSystem

    Synchronous version of Handler)

  23. 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.

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

    Deletes the file represented by the specified path, asynchronously.

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

    Synchronous version of boolean, Handler)

  26. def deleteSync(path: String): FileSystem

    Synchronous version of Handler)

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

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

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

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

  30. def existsSync(path: String): Boolean

    Synchronous version of Handler)

  31. def finalize(): Unit

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

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

  33. def fsPropsSync(path: String): FileSystemProps

    Synchronous version of Handler)

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

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

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

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

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

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

    Synchronous version of String, Handler)

  39. 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.

  40. def lpropsSync(path: String): FileProps

    Synchronous version of Handler)

  41. 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.

  42. 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.

  43. 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.

  44. 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.

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

    Synchronous version of String, boolean, Handler)

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

    Synchronous version of String, Handler)

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

    Synchronous version of boolean, Handler)

  48. def mkdirSync(path: String): FileSystem

    Synchronous version of Handler)

  49. 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.

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

    Synchronous version of String, Handler)

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

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

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

    Definition Classes
    AnyRef
  54. 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.

  55. 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.

  56. 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.

  57. 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.

  58. 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.

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

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

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

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

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

    Synchronous version of String, boolean, Handler)

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

    Synchronous version of String, Handler)

  63. def openSync(path: String): AsyncFile

    Synchronous version of Handler)

  64. 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.

  65. def propsSync(path: String): FileProps

    Synchronous version of Handler)

  66. 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.

  67. 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.

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

    Synchronous version of String, Handler)

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

    Synchronous version of Handler)

  70. 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.

  71. def readFileSync(path: String): Buffer

    Synchronous version of Handler)

  72. 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.

  73. def readSymlinkSync(link: String): String

    Synchronous version of Handler)

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

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

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

    Synchronous version of String, Handler)

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

    Definition Classes
    AnyRef
  77. def toString(): String

    Definition Classes
    AnyRef → Any
  78. 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.

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

    Synchronous version of long, Handler)

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

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

  81. def unlinkSync(link: String): FileSystem

    Synchronous version of Handler)

  82. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  85. 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
  86. 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.

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

    Synchronous version of Buffer, Handler)

Inherited from Self

Inherited from AnyRef

Inherited from Any

Ungrouped