FilePath

sealed trait FilePath extends BasePath

Represents a value that is either an absolute Path or a relative RelPath, and can be constructed from a java.nio.file.Path or java.io.File

Companion:
object
trait BasePath
class Object
trait Matchable
class Any
class Path
class RelPath
class SubPath

Type members

Inherited types

Inherited from:
BasePath

Value members

Abstract methods

def resolveFrom(base: Path): Path
def toNIO: Path

Inherited methods

def /(chunk: PathChunk): ThisType

Combines this path with the given relative path, returning a path of the same type as this one (e.g. Path returns Path, RelPath returns RelPath

Combines this path with the given relative path, returning a path of the same type as this one (e.g. Path returns Path, RelPath returns RelPath

Inherited from:
BasePath
def baseName: String

Gives you the base name of this path, ie without the extension

Gives you the base name of this path, ie without the extension

Inherited from:
BasePath
def endsWith(target: RelPath): Boolean

This path ends with the target path, including if it's identical

This path ends with the target path, including if it's identical

Inherited from:
BasePath
def ext: String

Gives you the file extension of this path, or the empty string if there is no extension

Gives you the file extension of this path, or the empty string if there is no extension

Inherited from:
BasePath
def last: String

The last segment in this path. Very commonly used, e.g. it represents the name of the file/folder in filesystem paths

The last segment in this path. Very commonly used, e.g. it represents the name of the file/folder in filesystem paths

Inherited from:
BasePath

Relativizes this path with the given target path, finding a relative path p such that base/p == this.

Relativizes this path with the given target path, finding a relative path p such that base/p == this.

Note that you can only relativize paths of the same type, e.g. Path & Path or RelPath & RelPath. In the case of RelPath, this can throw a PathError.NoRelativePath if there is no relative path that satisfies the above requirement in the general case.

Inherited from:
BasePath
def segments: IterableOnce[String]

The individual path segments of this path.

The individual path segments of this path.

Inherited from:
BasePath
def startsWith(target: ThisType): Boolean

This path starts with the target path, including if it's identical

This path starts with the target path, including if it's identical

Inherited from:
BasePath

Relativizes this path with the given target path, finding a sub path p such that base/p == this.

Relativizes this path with the given target path, finding a sub path p such that base/p == this.

Inherited from:
BasePath