Def
Checks end match
Checks end match
Returns true
if this
Path ends with p
val path: J.Path = "aaa" , "bbb" + "ccc" + "ddd"
path endsWith "ccc" , "ddd".tp // Prints: true
path endsWith "aaa" , "bbb".tp // Prints: false
- Inherited from
- _methods
- Source
- _methods.scala
Check exists
Check exists
Returns true
this
Path exists in the file system as file or directory
- Inherited from
- _methods
- Source
- _methods.scala
Sub-path index
Sub-path index
Optionally returns matching sub-path start index
val path: J.Path = "aaa" , "bbb" + "ccc" + "ddd" + "eee"
path indexOpt "ccc" , "ddd" tp // Prints: Opt(2)
path indexOpt "ddd" , "ccc" tp // Prints: Opt(VOID)
- Inherited from
- _methods
- Source
- _methods.scala
Last name
Last name
Returns last name in the Path hierarchy
If this Path points to a file, lastName
is the name of file
val path : J.Path = "Temp" , "Test.txt"
path.lastName tp // Prints: Test.txt
- Inherited from
- _methods
- Source
- _methods.scala
Real value
Real value
Returns real value standing behind the opaque type.
This is a zero cost call.
- Inherited from
- _methods
- Source
- Base.scala
Looses root if any
Looses root if any
If this
Path has a root, new Path without root is returned
Otherwise this
Path is returned as is
val p = J.Path("aaa" , "bbb").rootMake
p tp // May print: C:\aaa\bbb
p.rootDrop tp // May print: aaa\bbb
- Inherited from
- _methods
- Source
- _methods.scala
Makes root if none
Makes root if none
If this
Path has no root, new Path with current root is returned
Otherwise this
Path is returned as is
val p: J.Path = "aaa" , "bbb"
p tp // May print: aaa\bbb
p.rootMake tp // May print: C:\aaa\bbb
- Inherited from
- _methods
- Source
- _methods.scala
Optional root
Optional root
Optionally returns root Path if available
val p = J.Path("aaa" , "bbb").rootMake
p.rootOpt tp // May print: Opt(C:\)
p.rootDrop.rootOpt.tp // prints: Opt(VOID)
- Inherited from
- _methods
- Source
- _methods.scala
Checks start match
Checks start match
Returns true
if this
Path starts with p
val path: J.Path = "aaa" , "bbb" + "ccc" + "ddd"
path startsWith "aaa" , "bbb" tp // Prints: true
path startsWith "bbb" , "aaa" tp // Prints: false
- Inherited from
- _methods
- Source
- _methods.scala
Sub-path after
Sub-path after
Returns sub-path after p
- Value Params
- default
path if
p
is not found. If not specified, default is the original pathval p: J.Path = "aaa" , "bbb" + "ccc" + "ddd" + "eee" + "fff" p tp // Prints: aaa\bbb\ccc\ddd\eee\fff p subpathAfter "ccc" , "ddd" tp // Prints: eee\fff p subpathAfter "ddd" , "ccc" tp // Prints: aaa\bbb\ccc\ddd\eee\fff p subpathAfter ("ddd" , "ccc", "xyz" , "bbc") tp // Prints: xyz\bbc
- p
sub-path to copy after
- Inherited from
- _methods
- Source
- _methods.scala
Sub-path before
Sub-path before
Returns sub-path from start to p
- Value Params
- default
path if
p
is not found. If not specified, default is the original pathval p: J.Path = "aaa" , "bbb" + "ccc" + "ddd" + "eee" + "fff" p tp // Prints: aaa\bbb\ccc\ddd\eee\fff p subpathBefore "ccc" , "ddd" tp // Prints: aaa\bbb p subpathBefore "ddd" , "ccc" tp // Prints: aaa\bbb\ccc\ddd\eee\fff p subpathBefore ("ddd" , "ccc", "xyz" , "bbc") tp // Prints: xyz\bbc
- p
sub-path to copy up to
- Inherited from
- _methods
- Source
- _methods.scala
Sub-path from
Sub-path from
Returns sub-path starting from specified Path
- Value Params
- default
path if
p
is not found. If not specified, default is the original pathval p: J.Path = "aaa" , "bbb" + "ccc" + "ddd" + "eee" + "fff" p tp // Prints: aaa\bbb\ccc\ddd\eee\fff p subpathFrom "ccc" , "ddd" tp // Prints: ccc\ddd\eee\fff p subpathFrom "ddd" , "ccc" tp // Prints: aaa\bbb\ccc\ddd\eee\fff p subpathFrom ("ddd" , "ccc", "xyz" , "bbc").tp // Prints: xyz\bbc
- p
sub-path to copy from
- Inherited from
- _methods
- Source
- _methods.scala