Dotty Documentation

0.14.0-bin-SNAPSHOT

class Path
extends Object

The Path constructor is private so we can enforce some semantics regarding how a Path might relate to the world.

''Note: This library is considered experimental and should not be used unless you know what you are doing.''

[-] Constructors

Path ( jpath: JPath )

[-] Members

[+] val jpath : JPath
[+] val separator : Char
[+] val separatorStr : String
[+] def / ( child: String ) : Path

Creates a new Path with the specified path appended. Assumes the type of the new component implies the type of the result.

[+] def / ( child: Path ) : Path
[+] def / ( child: Directory ) : Directory
[+] def / ( child: File ) : File
[+] def addExtension ( ext: String ) : Path
[+] def canRead : Boolean
[+] def canWrite : Boolean
[+] def changeExtension ( ext: String ) : Path
[+] def createDirectory ( force: Boolean , failIfExists: Boolean ) : Directory
[+] def createDirectory$default$1 : Boolean
[+] def createDirectory$default$2 : Boolean
[+] def createFile ( failIfExists: Boolean ) : File
[+] def createFile$default$1 : Boolean
[+] def delete ( ) : Unit
[+] def deleteRecursively ( ) : Boolean

Deletes the path recursively. Returns false on failure. Use with caution!

[+] def endsWith ( other: Path ) : Boolean
[+] override def equals ( other: Any ) : Boolean
[+] def exists : Boolean
[+] def extension : String
[+] def hasExtension ( ext: String , exts: [ String ] ) : Boolean
[+] override def hashCode ( ) : Int
[+] def ifDirectory ( f: Directory => T ) : Option [ T ]
[+] def ifFile ( f: File => T ) : Option [ T ]
[+] def isAbsolute : Boolean
[+] def isDirectory : Boolean
[+] def isEmpty : Boolean
[+] def isFile : Boolean
[+] def isFresher ( other: Path ) : Boolean
[+] def isSame ( other: Path ) : Boolean
[+] def lastModified : FileTime
[+] def length : Long
[+] def name : String
[+] def normalize : Path
[+] def parent : Directory
[+] def parents : List [ Directory ]
[+] def path : String
[+] def relativize ( other: Path ) : Path
[+] def resolve ( other: Path ) : Path
[+] def segments : List [ String ]
[+] def stripExtension : String
[+] def toAbsolute : Path
[+] def toAbsoluteWithRoot ( root: Path ) : Path

If this path is absolute, returns it: otherwise, returns an absolute path made up of root / this.

[+] def toCanonical : Path
[+] def toDirectory : Directory
[+] def toFile : File
[+] override def toString ( ) : String
[+] def toURI : URI
[+] def toURL : URL
[+] def truncate ( ) : Boolean
[+] private def tryCreate ( create: => JPath ) : Boolean
[+] def walk : Iterator [ Path ]

Equivalent to walkFilter(_ => true).

[+] def walkFilter ( cond: Path => Boolean ) : Iterator [ Path ]

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