Path

class Path

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

Companion
object
class Object
trait Matchable
class Any
class Directory
class File

Value members

Concrete methods

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.

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 createDirectory(force: Boolean, failIfExists: Boolean): Directory
def createFile(failIfExists: Boolean): File
def delete(): Unit

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

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

def endsWith(other: Path): Boolean
override def equals(other: Any): Boolean
Definition Classes
Any
def hasExtension(ext: String, exts: String*): Boolean
override def hashCode(): Int
Definition Classes
Any
def ifDirectory[T](f: Directory => T): Option[T]
def ifFile[T](f: File => T): Option[T]
def isFresher(other: Path): Boolean
def isSame(other: Path): Boolean
def length: Long
def name: String
Returns

The path of the parent directory, or root if path is already root

def path: String
def relativize(other: Path): Path
def resolve(other: 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.

def toFile: File
override def toString(): String
Definition Classes
Any
def toURI: URI
def toURL: URL

Equivalent to walkFilter(_ => true).

Equivalent to walkFilter(_ => true).

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

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

Concrete fields

val jpath: JPath