@@ -13,9 +13,8 @@ import java.nio.file.{InvalidPathException, Paths}
1313
1414/** ''Note: This library is considered experimental and should not be used unless you know what you are doing.'' */
1515class PlainDirectory (givenPath : Directory ) extends PlainFile (givenPath) {
16- override def isDirectory : Boolean = true
16+ override val isDirectory : Boolean = true
1717 override def iterator (): Iterator [PlainFile ] = givenPath.list.filter(_.exists).map(new PlainFile (_))
18- override def delete (): Unit = givenPath.deleteRecursively()
1918}
2019
2120/** This class implements an abstract file backed by a File.
@@ -78,7 +77,7 @@ class PlainFile(val givenPath: Path) extends AbstractFile {
7877 }
7978
8079 /** Is this abstract file a directory? */
81- def isDirectory : Boolean = givenPath.isDirectory
80+ val isDirectory : Boolean = givenPath.isDirectory // cached for performance on Windows
8281
8382 /** Returns the time that this abstract file was last modified. */
8483 def lastModified : Long = givenPath.lastModified.toMillis
@@ -113,14 +112,6 @@ class PlainFile(val givenPath: Path) extends AbstractFile {
113112 null
114113 }
115114
116- /** Does this abstract file denote an existing file? */
117- def create (): Unit = if (! exists) givenPath.createFile()
118-
119- /** Delete the underlying file or directory (recursively). */
120- def delete (): Unit =
121- if (givenPath.isFile) givenPath.delete()
122- else if (givenPath.isDirectory) givenPath.toDirectory.deleteRecursively()
123-
124115 /** Returns a plain file with the given name. It does not
125116 * check that it exists.
126117 */
0 commit comments