Represents an absolute path on the file system, pointing to a file or directory that may or may not exist. Relative paths are interpreted as relative to the current working directory.
This type has a lot of shared API with the VirtualPath
abstraction in laika-core
via their common super-trait GenericPath
. Like the virtual path API it comes with convenience methods for querying and modifying suffix and fragment components, a common requirement in processing internal links for example.
However, it differs in three ways from the virtual path abstraction: first, semantically, as the latter is never intended to represent an actual file and instead just describes a tree structure of inputs (and AST documents after parsing).
Secondly, this type comes with additional APIs to convert to and from other path representations, namely java.io.File
, java.nio.file.Path
and fs2.io.file.Path
.
And finally, the toString
method for this type returns a platform-dependent string representation by using the file separator of the underlying file system. Laika's virtual path abstractions on the other hand always uses a forward slash /
as the separator.
Having a dedicated file path abstraction also helps with type signatures for methods in Laika's APIs that accept two path arguments: a file path and a virtual path indicating the mount point (at which the specified file is supposed to be inserted into the virtual tree).
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait GenericPathclass Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Creates a new path with the specified name as an immediate child of this path.
Creates a new path with the specified name as an immediate child of this path.
Attributes
- Definition Classes
-
GenericPath
Combines this path with the specified relative path.
Combines this path with the specified relative path.
Attributes
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)
).
Value parameters
- that
-
the object to compare against this object for equality.
Attributes
- Returns
-
true
if the receiver object is equivalent to the argument;false
otherwise. - Definition Classes
-
Any
The fragment part of the path (after a #
in the last segment), or None
if this path does not have a fragment component.
The fragment part of the path (after a #
in the last segment), or None
if this path does not have a fragment component.
Attributes
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
The local name of this path, without the optional fragment part, but including the suffix if present.
The local name of this path, without the optional fragment part, but including the suffix if present.
Attributes
The suffix of None
if this path name does not have a file suffix separated by a .
.
The suffix of None
if this path name does not have a file suffix separated by a .
.
Attributes
Converts this FilePath
to an fs2.io.file.Path
.
Converts this FilePath
to an fs2.io.file.Path
.
Attributes
Converts this FilePath
to an java.io.File
instance.
Converts this FilePath
to an java.io.File
instance.
Attributes
Converts this FilePath
to a java.nio.file.Path
.
Converts this FilePath
to a java.nio.file.Path
.
Attributes
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
-
Any
Inherited methods
Returns a new path that replaces the base name with the specified new name while keeping both, suffix and fragment, in case they are present.
Returns a new path that replaces the base name with the specified new name while keeping both, suffix and fragment, in case they are present.
Attributes
- Inherited from:
- GenericPath
Returns a new path that either replaces the existing fragment component with the specified one or appends it if this path does not have a component yet.
Returns a new path that either replaces the existing fragment component with the specified one or appends it if this path does not have a component yet.
Attributes
- Inherited from:
- GenericPath
Returns a new path that either replaces the existing suffix with the specified one or appends it if this path does not have a suffix yet.
Returns a new path that either replaces the existing suffix with the specified one or appends it if this path does not have a suffix yet.
Attributes
- Inherited from:
- GenericPath
Returns a new path that discards this path's fragment, if present.
Returns a new path that discards this path's fragment, if present.
Attributes
- Inherited from:
- GenericPath
Returns a new path that discards this path's suffix, if present.
Returns a new path that discards this path's suffix, if present.
Attributes
- Inherited from:
- GenericPath
Concrete fields
The base name of this path, without the suffix (if present).
The base name of this path, without the suffix (if present).
Attributes
Indicates whether this path is absolute. Relative paths are interpreted relative to the current working directory during a transformation.
Indicates whether this path is absolute. Relative paths are interpreted relative to the current working directory during a transformation.