class File extends Serializable

Scala wrapper around java.nio.files.Path

Annotations
@SerialVersionUID()
Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. File
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def /(child: Symbol): File
  4. def /(child: String): File
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def addPermission(permission: PosixFilePermission)(implicit linkOptions: LinkOptions = File.LinkOptions.default): File.this.type
  7. def append(text: String)(implicit charset: Charset = DefaultCharset): File.this.type
  8. def appendByteArray(bytes: Array[Byte]): File.this.type
  9. def appendBytes(bytes: Iterator[Byte]): File.this.type
  10. def appendLine(line: String = "")(implicit charset: Charset = DefaultCharset): File.this.type
  11. def appendLines(lines: String*)(implicit charset: Charset = DefaultCharset): File.this.type

    For large number of lines that may not fit in memory, use printLines

  12. def appendText(text: String)(implicit charset: Charset = DefaultCharset): File.this.type
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def asynchronousFileChannel(implicit openOptions: OpenOptions = File.OpenOptions.default): Dispose[AsynchronousFileChannel]
  15. def attributes(implicit linkOptions: LinkOptions = File.LinkOptions.default): BasicFileAttributes
  16. def bufferedReader(implicit charset: Charset = DefaultCharset): Dispose[BufferedReader]
  17. def bufferedWriter(implicit charset: Charset = DefaultCharset, openOptions: OpenOptions = File.OpenOptions.default): Dispose[BufferedWriter]
  18. def byteArray: Array[Byte]
  19. def bytes: Iterator[Byte]
  20. def canonicalFile: File
  21. def canonicalPath: String
  22. def changeExtensionTo(extension: String): File

    Changes the file-extension by renaming this file; if file does not have an extension, it adds the extension Example usage file"foo.java".changeExtensionTo(".scala")

    Changes the file-extension by renaming this file; if file does not have an extension, it adds the extension Example usage file"foo.java".changeExtensionTo(".scala")

    If file does not exist (or is a directory) no change is done and the current file is returned

  23. def chars(implicit charset: Charset = DefaultCharset): Iterator[Char]
  24. def checksum(algorithm: MessageDigest): String

    returns

    checksum of this file (or directory) in hex format

  25. def children: Iterator[File]
  26. def clear()(implicit linkOptions: LinkOptions = File.LinkOptions.default): File.this.type

    If this is a directory, remove all its children If its a file, empty the contents

    If this is a directory, remove all its children If its a file, empty the contents

    returns

    this

  27. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  28. def collectChildren(matchFilter: (File) => Boolean, maxDepth: Int = Int.MaxValue)(implicit visitOptions: VisitOptions = File.VisitOptions.default): Iterator[File]

    More Scala friendly way of doing Files.walk Note: This is lazy (returns an Iterator) and won't evaluate till we reify the iterator (e.g.

    More Scala friendly way of doing Files.walk Note: This is lazy (returns an Iterator) and won't evaluate till we reify the iterator (e.g. using .toList)

  29. def contains(file: File, strict: Boolean = true): Boolean

    Check if this directory contains this file

    Check if this directory contains this file

    strict

    If strict is false, it would return true for self.contains(self)

    returns

    true if this is a directory and it contains this file

  30. def contentAsString(implicit charset: Charset = DefaultCharset): String
  31. def contentType: Option[String]
  32. def copyTo(destination: File, overwrite: Boolean = false)(implicit copyOptions: CopyOptions = File.CopyOptions(overwrite)): destination.type

    returns

    destination

  33. def copyToDirectory(directory: File)(implicit linkOptions: LinkOptions = File.LinkOptions.default, copyOptions: CopyOptions = File.CopyOptions.default): File

    Copies this file into the given directory

    Copies this file into the given directory

    returns

    the File referencing the new file created under destination

  34. def createChild(child: String, asDirectory: Boolean = false, createParents: Boolean = false)(implicit attributes: Attributes = File.Attributes.default, linkOptions: LinkOptions = File.LinkOptions.default): File
  35. def createDirectories()(implicit attributes: Attributes = File.Attributes.default, linkOptions: LinkOptions = File.LinkOptions.default): File.this.type

    Create this directory and all its parents Unlike the JDK, this by default sanely handles the JDK-8130464 bug If you want default Java behaviour, use File.LinkOptions.noFollow

  36. def createDirectory()(implicit attributes: Attributes = File.Attributes.default): File.this.type

    Create this directory

  37. def createDirectoryIfNotExists(createParents: Boolean = false)(implicit attributes: Attributes = File.Attributes.default, linkOptions: LinkOptions = File.LinkOptions.default): File.this.type
  38. def createFile()(implicit attributes: Attributes = File.Attributes.default): File.this.type

    Create this file

  39. def createFileIfNotExists(createParents: Boolean = false)(implicit attributes: Attributes = File.Attributes.default, linkOptions: LinkOptions = File.LinkOptions.default): File.this.type
  40. def createIfNotExists(asDirectory: Boolean = false, createParents: Boolean = false)(implicit attributes: Attributes = File.Attributes.default, linkOptions: LinkOptions = File.LinkOptions.default): File.this.type

    Create this file.

    Create this file. If it exists, don't do anything

    asDirectory

    If you want this file to be created as a directory instead, set this to true (false by default)

    createParents

    If you also want all the parents to be created from root to this file (false by default)

  41. def delete(swallowIOExceptions: Boolean = false, linkOption: LinkOptions = File.LinkOptions.noFollow): File.this.type

    Deletes this file or directory Unless otherwise specified, this does not follow symlinks i.e.

    Deletes this file or directory Unless otherwise specified, this does not follow symlinks i.e. if this is a symlink, only the symlink itself is deleted and not the linked object

    swallowIOExceptions

    If this is set to true, any exception thrown is swallowed

  42. def deleteOnExit(swallowIOExceptions: Boolean = false, linkOption: LinkOptions = File.LinkOptions.noFollow): File.this.type
  43. def digest(algorithm: MessageDigest): Array[Byte]
  44. def dosAttributes(implicit linkOptions: LinkOptions = File.LinkOptions.default): DosFileAttributes
  45. def entries: Iterator[File]
  46. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  47. def equals(obj: Any): Boolean
    Definition Classes
    File → AnyRef → Any
  48. def exists(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  49. def extension(includeDot: Boolean = true, includeAll: Boolean = false, toLowerCase: Boolean = true): Option[String]

    includeDot

    whether the dot should be included in the extension or not

    includeAll

    whether all extension tokens should be included, or just the last one e.g. for bundle.tar.gz should it be .tar.gz or .gz

    toLowerCase

    to lowercase the extension or not e.g. foo.HTML should have .html or .HTML

    returns

    extension of this file if it is a regular file and has an extension, else None

  50. def extension: Option[String]

    returns

    extension (including the dot) of this file if it is a regular file and has an extension, else None

  51. def fileChannel(implicit openOptions: OpenOptions = File.OpenOptions.default, attributes: Attributes = File.Attributes.default): Dispose[FileChannel]
  52. def fileInputStream: Dispose[FileInputStream]
  53. def fileOutputStream(append: Boolean = false): Dispose[FileOutputStream]
  54. def fileReader: Dispose[FileReader]
  55. implicit val fileSystem: FileSystem
  56. def fileWriter(append: Boolean = false): Dispose[FileWriter]
  57. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  58. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  59. def glob(pattern: String, includePath: Boolean = true, maxDepth: Int = Int.MaxValue)(implicit syntax: PathMatcherSyntax = File.PathMatcherSyntax.default, visitOptions: VisitOptions = File.VisitOptions.default): Iterator[File]

    Util to glob from this file's path

    Util to glob from this file's path

    includePath

    If true, we don't need to set path glob patterns e.g. instead of *

  60. def globRegex(pattern: Regex, includePath: Boolean = true, maxDepth: Int = Int.MaxValue)(implicit visitOptions: VisitOptions = File.VisitOptions.default): Iterator[File]

    Util to match from this file's path using Regex

    Util to match from this file's path using Regex

    includePath

    If true, we don't need to set path glob patterns e.g. instead of *

  61. def group(implicit linkOptions: LinkOptions = File.LinkOptions.default): GroupPrincipal
  62. def groupName(implicit linkOptions: LinkOptions = File.LinkOptions.default): String
  63. def gzipInputStream(bufferSize: Int = DefaultBufferSize): Dispose[GZIPInputStream]
  64. def gzipOutputStream(bufferSize: Int = DefaultBufferSize, syncFlush: Boolean = false, append: Boolean = false): Dispose[GZIPOutputStream]
  65. def gzipTo(destination: File = File.newTemporaryFile(suffix = name + ".gz"), bufferSize: Int = DefaultBufferSize, syncFlush: Boolean = false, append: Boolean = false): destination.type

  66. def hasExtension: Boolean

    Returns the extension if file is a regular file If file is unreadable or does not exist, it is assumed to be not a regular file See: https://github.com/pathikrit/better-files/issues/89

  67. def hashCode(): Int
    Definition Classes
    File → AnyRef → Any
  68. def inputStream(implicit openOptions: OpenOptions = File.OpenOptions.default): Dispose[InputStream]
  69. def isChildOf(parent: File): Boolean
  70. def isDirectory(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean

    returns

    true if this file (or the file found by following symlink) is a directory

  71. def isEmpty(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean

    returns

    true if file is not present or empty directory or 0-bytes file

  72. def isExecutable: Boolean
  73. def isGroupExecutable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  74. def isGroupReadable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  75. def isGroupWritable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  76. def isHidden: Boolean
  77. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  78. def isLocked(mode: RandomAccessMode, position: Long = 0L, size: Long = Long.MaxValue, isShared: Boolean = false)(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean

    Check if a file is locked.

    Check if a file is locked.

    mode

    The random access mode.

    position

    The position at which the locked region is to start; must be non-negative.

    size

    The size of the locked region; must be non-negative, and the sum position + size must be non-negative.

    isShared

    true to request a shared lock, false to request an exclusive lock.

    returns

    True if the file is locked, false otherwise.

  79. def isOthersExecutable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  80. def isOthersReadable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  81. def isOthersWritable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  82. def isOwnerExecutable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  83. def isOwnerReadable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  84. def isOwnerWritable(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  85. def isParentOf(child: File): Boolean
  86. def isReadLocked(position: Long = 0L, size: Long = Long.MaxValue, isShared: Boolean = false): Boolean
  87. def isReadable: Boolean

    This differs from the above as this checks if the JVM can read this file even though the OS cannot in certain platforms

    This differs from the above as this checks if the JVM can read this file even though the OS cannot in certain platforms

    See also

    isOwnerReadable

  88. def isRegularFile(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean

    returns

    true if this file (or the file found by following symlink) is a regular file

  89. def isSameContentAs(that: File): Boolean

    returns

    true if this file is exactly same as that file For directories, it checks for equivalent directory structure

  90. def isSameFileAs(that: File): Boolean
  91. def isSamePathAs(that: File): Boolean
  92. def isSiblingOf(sibling: File): Boolean
  93. def isSimilarContentAs(that: File): Boolean

    Almost same as isSameContentAs but uses faster md5 hashing to compare (and thus small chance of false positive) Also works for directories

  94. def isSymbolicLink: Boolean
  95. def isWritable: Boolean
  96. def isWriteLocked(position: Long = 0L, size: Long = Long.MaxValue, isShared: Boolean = false): Boolean
  97. def lastModifiedTime(implicit linkOptions: LinkOptions = File.LinkOptions.default): Instant
  98. def lineCount(implicit charset: Charset = DefaultCharset): Long
  99. def lineIterator(implicit charset: Charset = DefaultCharset): Iterator[String]

    Iterate over lines in a file (auto-close stream on complete) NOTE: If the iteration is partial, it may leave a stream open If you want partial iteration use @see lines()

  100. def lines(implicit charset: Charset = DefaultCharset): Traversable[String]

    Load all lines from this file Note: Large files may cause an OutOfMemory in which case, use the streaming version @see lineIterator

    Load all lines from this file Note: Large files may cause an OutOfMemory in which case, use the streaming version @see lineIterator

    returns

    all lines in this file

  101. def linkTo(destination: File, symbolic: Boolean = false)(implicit attributes: Attributes = File.Attributes.default): destination.type
  102. def list: Iterator[File]
  103. def list(filter: (File) => Boolean, maxDepth: Int = Int.MaxValue, visitOptions: VisitOptions = File.VisitOptions.default): Iterator[File]

    List files recursively up to given depth using a custom file filter

  104. def listRecursively(implicit visitOptions: VisitOptions = File.VisitOptions.default): Iterator[File]
  105. def listRelativePaths(implicit visitOptions: VisitOptions = File.VisitOptions.default): Iterator[Path]
  106. def loadBytes: Array[Byte]
  107. def md5: String
  108. def moveTo(destination: File)(implicit copyOptions: CopyOptions = File.CopyOptions(overwrite = false)): destination.type

    returns

    destination

  109. def moveToDirectory(directory: File)(implicit linkOptions: LinkOptions = File.LinkOptions.default): File

    Moves this file into the given directory

    Moves this file into the given directory

    returns

    the File referencing the new file created under destination

  110. def name: String

    Name of file Certain files may not have a name e.g.

    Name of file Certain files may not have a name e.g. root directory - returns empty string in that case

  111. def nameOption: Option[String]

    Certain files may not have a name e.g.

    Certain files may not have a name e.g. root directory - returns None in that case

  112. def nameWithoutExtension(includeAll: Boolean): String

    includeAll

    For files with multiple extensions e.g. "bundle.tar.gz" nameWithoutExtension(includeAll = true) returns "bundle" nameWithoutExtension(includeAll = false) returns "bundle.tar"

  113. def nameWithoutExtension: String
  114. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  115. def newAsynchronousFileChannel(implicit openOptions: OpenOptions = File.OpenOptions.default): AsynchronousFileChannel
  116. def newBufferedReader(implicit charset: Charset = DefaultCharset): BufferedReader
  117. def newBufferedWriter(implicit charset: Charset = DefaultCharset, openOptions: OpenOptions = File.OpenOptions.default): BufferedWriter
  118. def newFileChannel(implicit openOptions: OpenOptions = File.OpenOptions.default, attributes: Attributes = File.Attributes.default): FileChannel
  119. def newFileInputStream: FileInputStream
  120. def newFileOutputStream(append: Boolean = false): FileOutputStream
  121. def newFileReader: FileReader
  122. def newFileWriter(append: Boolean = false): FileWriter
  123. def newGzipInputStream(bufferSize: Int = DefaultBufferSize): GZIPInputStream
  124. def newGzipOutputStream(bufferSize: Int = DefaultBufferSize, syncFlush: Boolean = false, append: Boolean = false): GZIPOutputStream
  125. def newInputStream(implicit openOptions: OpenOptions = File.OpenOptions.default): InputStream
  126. def newOutputStream(implicit openOptions: OpenOptions = File.OpenOptions.default): OutputStream
  127. def newPrintWriter(autoFlush: Boolean = false)(implicit openOptions: OpenOptions = File.OpenOptions.default): PrintWriter
  128. def newRandomAccess(mode: RandomAccessMode = File.RandomAccessMode.read): RandomAccessFile
  129. def newScanner(splitter: StringSplitter = StringSplitter.Default)(implicit charset: Charset = DefaultCharset): Scanner
  130. def newWatchService: WatchService
  131. def newZipInputStream(implicit charset: Charset = DefaultCharset): ZipInputStream
  132. def newZipOutputStream(implicit openOptions: OpenOptions = File.OpenOptions.default, charset: Charset = DefaultCharset): ZipOutputStream
  133. def nonEmpty(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean

    returns

    for directories, true if it has no children, false otherwise for files, true if it is a 0-byte file, false otherwise else true if it exists, false otherwise

  134. def notExists(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean
  135. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  136. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  137. def outputStream(implicit openOptions: OpenOptions = File.OpenOptions.default): Dispose[OutputStream]
  138. def overwrite(text: String)(implicit openOptions: OpenOptions = File.OpenOptions.default, charset: Charset = DefaultCharset): File.this.type
  139. def owner(implicit linkOptions: LinkOptions = File.LinkOptions.default): UserPrincipal
  140. def ownerName(implicit linkOptions: LinkOptions = File.LinkOptions.default): String
  141. def parent: File

    Return parent of this file NOTE: This API returns null if this file is the root; please use parentOption if you expect to handle roots

    Return parent of this file NOTE: This API returns null if this file is the root; please use parentOption if you expect to handle roots

    See also

    parentOption

  142. def parentOption: Option[File]

    returns

    Some(parent) of this file or None if this is the root and thus has no parent

  143. val path: Path
  144. def pathAsString: String
  145. def pathMatcher(syntax: PathMatcherSyntax, includePath: Boolean)(pattern: String): PathMatcher
  146. def permissions(implicit linkOptions: LinkOptions = File.LinkOptions.default): Set[PosixFilePermission]
  147. def permissionsAsString(implicit linkOptions: LinkOptions = File.LinkOptions.default): String
  148. def posixAttributes(implicit linkOptions: LinkOptions = File.LinkOptions.default): PosixFileAttributes
  149. def printLines(lines: TraversableOnce[_])(implicit openOptions: OpenOptions = File.OpenOptions.append): File.this.type
  150. def printWriter(autoFlush: Boolean = false)(implicit openOptions: OpenOptions = File.OpenOptions.default): Dispose[PrintWriter]
  151. def randomAccess(mode: RandomAccessMode = File.RandomAccessMode.read): Dispose[RandomAccessFile]
  152. def readDeserialized[A](classLoaderOverride: Option[ClassLoader] = None, bufferSize: Int = DefaultBufferSize)(implicit openOptions: OpenOptions = File.OpenOptions.default): A

    Deserialize a object using Java's default serialization from this file

  153. def register(service: WatchService, events: Events = File.Events.all): File.this.type
  154. def relativize(destination: File): Path
  155. def removePermission(permission: PosixFilePermission)(implicit linkOptions: LinkOptions = File.LinkOptions.default): File.this.type
  156. def renameTo(newName: String): File
  157. def root: File
  158. def scanner(splitter: StringSplitter = StringSplitter.Default)(implicit charset: Charset = DefaultCharset): Dispose[Scanner]
  159. def setGroup(group: String)(implicit linkOptions: LinkOptions = File.LinkOptions.default): File.this.type
  160. def setOwner(owner: String): File.this.type
  161. def setPermissions(permissions: Set[PosixFilePermission]): File.this.type
  162. def sha1: String
  163. def sha256: String
  164. def sha512: String
  165. def sibling(name: String): File
  166. def siblings: Iterator[File]
  167. def size(returnZeroIfMissing: Boolean)(implicit visitOptions: VisitOptions): Long

    returnZeroIfMissing

    If true, return zeroes for missing files*

    returns

    file size (for directories, return size of the directory) in bytes

  168. def size(implicit visitOptions: VisitOptions = File.VisitOptions.default): Long

    returns

    file size (for directories, return size of the directory) in bytes

  169. def streamedUnzip(destinationDirectory: File = File.newTemporaryDirectory(name.stripSuffix(".zip")))(implicit charset: Charset = DefaultCharset): destinationDirectory.type

    Streamed unzipping is slightly slower but supports larger files and more encodings

    Streamed unzipping is slightly slower but supports larger files and more encodings

    destinationDirectory

    destination folder; Creates this if it does not exist

    returns

    The destination where contents are unzipped

    See also

    https://github.com/pathikrit/better-files/issues/152

  170. def symbolicLink: Option[File]

    returns

    Some(target) if this is a symbolic link (to target) else None

  171. def symbolicLinkTo(destination: File)(implicit attributes: Attributes = File.Attributes.default): destination.type
  172. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  173. def testPermission(permission: PosixFilePermission)(implicit linkOptions: LinkOptions = File.LinkOptions.default): Boolean

    test if file has this permission

  174. def toJava: java.io.File
  175. def toString(): String
    Definition Classes
    File → AnyRef → Any
  176. def toTemporary: Dispose[File]

    Java's temporary files/directories are not cleaned up by default.

    Java's temporary files/directories are not cleaned up by default. If we explicitly call .deleteOnExit(), it gets added to shutdown handler which is not ideal for long running systems with millions of temporary files as: a) it would slowdown shutdown and b) occupy unnecessary disk-space during app lifetime

    This util auto-deletes the resource when done using the Dispose facility

    Example usage: File.temporaryDirectory().foreach(tempDir => doSomething(tempDir)

  177. def tokens(splitter: StringSplitter = StringSplitter.Default)(implicit charset: Charset = DefaultCharset): Iterator[String]
  178. def touch(time: Instant = Instant.now())(implicit attributes: Attributes = File.Attributes.default, linkOptions: LinkOptions = File.LinkOptions.default): File.this.type

    Similar to the UNIX command touch - create this file if it does not exist and set its last modification time

  179. def unGzipTo(destination: File = File.newTemporaryFile(suffix = name.stripSuffix(".gz")), append: Boolean = false, bufferSize: Int = DefaultBufferSize): destination.type
  180. def unzip(zipFilter: (ZipEntry) => Boolean = _ => true)(implicit charset: Charset = DefaultCharset): File

    unzip to a temporary zip file

    unzip to a temporary zip file

    returns

    the zip file

  181. def unzipTo(destination: File = File.newTemporaryDirectory(name.stripSuffix(".zip")), zipFilter: (ZipEntry) => Boolean = _ => true)(implicit charset: Charset = DefaultCharset): destination.type

    Unzips this zip file

    Unzips this zip file

    destination

    destination folder; Creates this if it does not exist

    zipFilter

    An optional param to reject or accept unzipping a file

    returns

    The destination where contents are unzipped

  182. def update(attribute: String, value: Any)(implicit linkOptions: LinkOptions = File.LinkOptions.default): File.this.type

    Set a file attribute e.g.

    Set a file attribute e.g. file("dos:system") = true

  183. def uri: URI
  184. def url: URL
  185. def usingLock[U](mode: RandomAccessMode)(f: (FileChannel) => U): U
  186. def verifiedExists(implicit linkOptions: LinkOptions = File.LinkOptions.default): Option[Boolean]

    returns

    Some(true) if file is guaranteed to exist Some(false) if file is guaranteed to not exist None if the status is unknown e.g. if file is unreadable

    See also

    https://docs.oracle.com/javase/tutorial/essential/io/check.html

    https://stackoverflow.com/questions/30520179/why-does-file-exists-return-true-even-though-files-exists-in-the-nio-files

  187. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  188. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  189. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  190. def walk(maxDepth: Int = Int.MaxValue)(implicit visitOptions: VisitOptions = File.VisitOptions.default): Iterator[File]

    Walk the directory tree recursively upto maxDepth

    Walk the directory tree recursively upto maxDepth

    returns

    List of children in BFS maxDepth level deep (includes self since self is at depth = 0)

  191. def watchService: Dispose[WatchService]
  192. def write(text: String)(implicit openOptions: OpenOptions = File.OpenOptions.default, charset: Charset = DefaultCharset): File.this.type
  193. def writeByteArray(bytes: Array[Byte])(implicit openOptions: OpenOptions = File.OpenOptions.default): File.this.type

    Write byte array to file.

    Write byte array to file. For large contents consider using the writeBytes

    returns

    this

  194. def writeBytes(bytes: Iterator[Byte])(implicit openOptions: OpenOptions = File.OpenOptions.default): File.this.type
  195. def writeSerialized(obj: Serializable, bufferSize: Int = DefaultBufferSize)(implicit openOptions: OpenOptions = File.OpenOptions.default): File.this.type

    Serialize a object using Java's serializer into this file, creating it and its parents if they do not exist

  196. def writeText(text: String)(implicit openOptions: OpenOptions = File.OpenOptions.default, charset: Charset = DefaultCharset): File.this.type
  197. def zip(compressionLevel: Int = Deflater.DEFAULT_COMPRESSION)(implicit charset: Charset = DefaultCharset): File

    zip to a temp directory

    zip to a temp directory

    returns

    the target directory

  198. def zipIn(files: Iterator[File], compressionLevel: Int = Deflater.DEFAULT_COMPRESSION)(implicit charset: Charset = DefaultCharset): File.this.type

    Adds these files into this zip file Example usage: File("test.zip").zipIn(Seq(file"hello.txt", file"hello2.txt"))

    Adds these files into this zip file Example usage: File("test.zip").zipIn(Seq(file"hello.txt", file"hello2.txt"))

    returns

    this

  199. def zipInputStream(implicit charset: Charset = DefaultCharset): Dispose[ZipInputStream]
  200. def zipOutputStream(implicit openOptions: OpenOptions = File.OpenOptions.default, charset: Charset = DefaultCharset): Dispose[ZipOutputStream]
  201. def zipTo(destination: File, compressionLevel: Int = Deflater.DEFAULT_COMPRESSION)(implicit charset: Charset = DefaultCharset): destination.type

    Zips this file (or directory)

    Zips this file (or directory)

    destination

    The destination file; Creates this if it does not exists

    returns

    The destination zip file

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped