Path to a file or directory on a file system.
The path API is inspired by the java.nio.file.Path
API. On the JVM,
a NIO path can be converted to an FS2 path via Path.fromNioPath(p)
and likewise an FS2 path can be converted to a NIO path via p.toNioPath
.
(When using this class on Node.js, the fromNioPath
and toNioPath
methods are
not accessible.)
Generally, most methods have the same behavior as their NIO counterparts, though
there are some slight differences -- e.g., resolve
normalizes.
Attributes
- Companion:
- object
- Source:
- Path.scala
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Joins the given path segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.
Joins the given path segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.
Attributes
- Source:
- Path.scala
Joins the given path segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.
Joins the given path segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.
Attributes
- Source:
- Path.scala
Returns a Path object representing the absolute path of this path.
Tests if this path ends with the given path. If the given path has N elements, and no root component, and this path has N or more elements, then this path ends with the given path if the last N elements of each path, starting at the element farthest from the root, are equal.
Tests if this path ends with the given path. If the given path has N elements, and no root component, and this path has N or more elements, then this path ends with the given path if the last N elements of each path, starting at the element farthest from the root, are equal.
Attributes
- Source:
- Path.scala
Tests if this path ends with the given path. If the given path has N elements, and no root component, and this path has N or more elements, then this path ends with the given path if the last N elements of each path, starting at the element farthest from the root, are equal.
Tests if this path ends with the given path. If the given path has N elements, and no root component, and this path has N or more elements, then this path ends with the given path if the last N elements of each path, starting at the element farthest from the root, are equal.
Attributes
- Source:
- Path.scala
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance
x
of typeAny
,x.equals(x)
should returntrue
. - It is symmetric: for any instances
x
andy
of typeAny
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any instances
x
,y
, andz
of typeAny
ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
.
If you override this method, you should verify that your implementation remains an equivalence relation.
Additionally, when overriding this method it is usually necessary to override hashCode
to ensure that
objects which are "equal" (o1.equals(o2)
returns true
) hash to the same scala.Int.
(o1.hashCode.equals(o2.hashCode)
).
Attributes
- that
the object to compare against this object for equality.
- Returns:
true
if the receiver object is equivalent to the argument;false
otherwise.- Definition Classes
- Any
- Source:
- Path.scala
Returns the extension of the path, from the last occurrence of the . (period) character to end of string in the last portion of the path. If there is no . in the last portion of the path, or if there are no . characters other than the first character of the filename of path, an empty string is returned.
Returns the extension of the path, from the last occurrence of the . (period) character to end of string in the last portion of the path. If there is no . in the last portion of the path, or if there are no . characters other than the first character of the filename of path, an empty string is returned.
Attributes
- Source:
- Path.scala
Returns the name of the file or directory denoted by this path as a Path object. The file name is the farthest element from the root in the directory hierarchy.
Returns the name of the file or directory denoted by this path as a Path object. The file name is the farthest element from the root in the directory hierarchy.
Attributes
- Source:
- Path.scala
Calculate a hash code value for the object.
Calculate a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)
) yet
not be equal (o1.equals(o2)
returns false
). A degenerate implementation could always return 0
.
However, it is required that if two objects are equal (o1.equals(o2)
returns true
) that they have
identical hash codes (o1.hashCode.equals(o2.hashCode)
). Therefore, when overriding this method, be sure
to verify that the behavior is consistent with the equals
method.
Attributes
- Returns:
the hash code value for this object.
- Definition Classes
- Any
- Source:
- Path.scala
Tells whether or not this path is absolute.
Returns the name elements in the path.
Returns a path that is this path with redundant name elements eliminated.
Returns a path that is this path with redundant name elements eliminated.
Attributes
- Source:
- Path.scala
Returns the parent path, or None if this path does not have a parent.
Constructs a relative path between this path and a given path.
Resolve the given path against this path.
Resolve the given path against this path.
Resolves the given path against this path's parent path.
Resolves the given path against this path's parent path.
Tests if this path starts with the given path. This path starts with the given path if this path's root component starts with the root component of the given path, and this path starts with the same name elements as the given path. If the given path has more name elements than this path then false is returned.
Tests if this path starts with the given path. This path starts with the given path if this path's root component starts with the root component of the given path, and this path starts with the same name elements as the given path. If the given path has more name elements than this path then false is returned.
Attributes
- Source:
- Path.scala
Tests if this path starts with the given path. This path starts with the given path if this path's root component starts with the root component of the given path, and this path starts with the same name elements as the given path. If the given path has more name elements than this path then false is returned.
Tests if this path starts with the given path. This path starts with the given path if this path's root component starts with the root component of the given path, and this path starts with the same name elements as the given path. If the given path has more name elements than this path then false is returned.
Attributes
- Source:
- Path.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns:
a string representation of the object.
- Definition Classes
- PathApi -> Any
- Source:
- Path.scala
Concrete fields
Attributes
- Source:
- Path.scala