class FilePath extends GenericPath
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).
- Alphabetic
- By Inheritance
- FilePath
- GenericPath
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
Self = FilePath
- Definition Classes
- FilePath → GenericPath
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
/(path: RelativePath): FilePath
Combines this path with the specified relative path.
Combines this path with the specified relative path.
- Definition Classes
- FilePath → GenericPath
-
def
/(name: String): FilePath
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.
- Definition Classes
- FilePath → GenericPath
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
basename: String
The base name of this path, without the suffix (if present).
The base name of this path, without the suffix (if present).
- Definition Classes
- FilePath → GenericPath
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
copyWith(basename: String, suffix: Option[String], fragment: Option[String]): FilePath
- Attributes
- protected
- Definition Classes
- FilePath → GenericPath
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
- Definition Classes
- FilePath → AnyRef → Any
-
def
fragment: Option[String]
The fragment part of the path (after a
#
in the last segment), orNone
if this path does not have a fragment component.The fragment part of the path (after a
#
in the last segment), orNone
if this path does not have a fragment component.- Definition Classes
- FilePath → GenericPath
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- FilePath → AnyRef → Any
-
val
isAbsolute: Boolean
Indicates whether this path is absolute.
Indicates whether this path is absolute. Relative paths are interpreted relative to the current working directory during a transformation.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
name: String
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.
- Definition Classes
- FilePath → GenericPath
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
suffix: Option[String]
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.
.- Definition Classes
- FilePath → GenericPath
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toFS2Path: Path
Converts this
FilePath
to anfs2.io.file.Path
. -
def
toJavaFile: File
Converts this
FilePath
to anjava.io.File
instance. -
def
toNioPath: Path
Converts this
FilePath
to ajava.nio.file.Path
. -
def
toString(): String
- Definition Classes
- FilePath → AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withBasename(name: String): Self
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.
- Definition Classes
- GenericPath
-
def
withFragment(fragment: String): Self
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.
- Definition Classes
- GenericPath
-
def
withSuffix(suffix: String): Self
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.
- Definition Classes
- GenericPath
-
def
withoutFragment: Self
Returns a new path that discards this path's fragment, if present.
Returns a new path that discards this path's fragment, if present.
- Definition Classes
- GenericPath
-
def
withoutSuffix: Self
Returns a new path that discards this path's suffix, if present.
Returns a new path that discards this path's suffix, if present.
- Definition Classes
- GenericPath
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated