class Directory extends Path
An abstraction for directories.
- Since
2.8 Note: This is library is considered experimental and should not be used unless you know what you are doing.
- Alphabetic
- By Inheritance
- Directory
- Path
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Directory(jfile: java.io.File)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
/(child: File): File
- Definition Classes
- Path
-
def
/(child: Directory): Directory
- Definition Classes
- Path
-
def
/(child: Path): Path
Creates a new Path with the specified path appended.
Creates a new Path with the specified path appended. Assumes the type of the new component implies the type of the result.
- Definition Classes
- Path
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addExtension(ext: String): Path
- Definition Classes
- Path
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
canRead: Boolean
- Definition Classes
- Path
-
def
canWrite: Boolean
- Definition Classes
- Path
-
def
changeExtension(ext: String): Path
- Definition Classes
- Path
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
createDirectory(force: Boolean = true, failIfExists: Boolean = false): Directory
- Definition Classes
- Path
-
def
createFile(failIfExists: Boolean = false): File
- Definition Classes
- Path
- def deepFiles: Iterator[File]
-
def
deepList(depth: Int = -1): Iterator[Path]
If optional depth argument is not given, will recurse until it runs out of contents.
-
def
delete(): Boolean
- Definition Classes
- Path
-
def
deleteRecursively(): Boolean
Deletes the path recursively.
Deletes the path recursively. Returns false on failure. Use with caution!
- Definition Classes
- Path
- def dirs: Iterator[Directory]
-
def
endsWith(other: Path): Boolean
- Definition Classes
- Path
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
- Definition Classes
- Path → AnyRef → Any
-
def
exists: Boolean
- Definition Classes
- Path
-
def
extension: String
- Definition Classes
- Path
- def files: Iterator[File]
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hasExtension(ext: String, exts: String*): Boolean
- Definition Classes
- Path
-
def
hashCode(): Int
- Definition Classes
- Path → AnyRef → Any
-
def
ifDirectory[T](f: (Directory) ⇒ T): Option[T]
- Definition Classes
- Path
-
def
ifFile[T](f: (File) ⇒ T): Option[T]
- Definition Classes
- Path
-
def
isAbsolute: Boolean
- Definition Classes
- Path
-
def
isDirectory: Boolean
- Definition Classes
- Path
-
def
isEmpty: Boolean
- Definition Classes
- Path
-
def
isFile: Boolean
- Definition Classes
- Path
-
def
isFresher(other: Path): Boolean
- Definition Classes
- Path
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isSame(other: Path): Boolean
- Definition Classes
- Path
-
val
jfile: java.io.File
- Definition Classes
- Path
-
def
lastModified: Long
- Definition Classes
- Path
-
def
length: Long
- Definition Classes
- Path
-
def
list: Iterator[Path]
An iterator over the contents of this directory.
-
def
name: String
- Definition Classes
- Path
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def normalize: Directory
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
parent: Directory
- returns
The path of the parent directory, or root if path is already root
- Definition Classes
- Path
-
def
parents: List[Directory]
- Definition Classes
- Path
-
def
path: String
- Definition Classes
- Path
-
def
relativize(other: Path): Path
- Definition Classes
- Path
-
def
resolve(other: Path): Path
- Definition Classes
- Path
-
def
segments: List[String]
- Definition Classes
- Path
-
val
separator: Char
- Definition Classes
- Path
-
val
separatorStr: String
- Definition Classes
- Path
-
def
stripExtension: String
- Definition Classes
- Path
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toAbsolute: Directory
-
def
toAbsoluteWithRoot(root: Path): Path
If this path is absolute, returns it: otherwise, returns an absolute path made up of root / this.
If this path is absolute, returns it: otherwise, returns an absolute path made up of root / this.
- Definition Classes
- Path
-
def
toCanonical: Path
- Definition Classes
- Path
- def toDirectory: Directory
- def toFile: File
-
def
toString(): String
- Definition Classes
- Path → AnyRef → Any
-
def
toURI: URI
- Definition Classes
- Path
-
def
toURL: URL
- Definition Classes
- Path
-
def
truncate(): Boolean
- Definition Classes
- Path
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
walk: Iterator[Path]
Equivalent to walkFilter(_ => true).
Equivalent to walkFilter(_ => true).
- Definition Classes
- Path
-
def
walkFilter(cond: (Path) ⇒ Boolean): Iterator[Path]
If this path is a directory, recursively iterate over its contents.
If this path is a directory, recursively iterate over its contents. The supplied condition is a filter which is applied to each element, with that branch of the tree being closed off if it is false. So for example if the condition is false for some subdirectory, nothing under that directory will be in the Iterator. If it's true, all files for which the condition holds and are directly in that subdirectory are in the Iterator, and all sub-subdirectories are recursively evaluated