implicit final class GlobOps extends AnyVal
Provides extension methods for Glob.
- Alphabetic
- By Inheritance
- GlobOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
def
/(relativeGlob: RelativeGlob): Glob
Appends a relative glob path to an existing Glob.
Appends a relative glob path to an existing Glob. For example:
val glob = Glob("foo/bar") val scalaSources = glob / "**<code>/</code>*.scala" scalaSources.matches(Paths.get("foo/bar/Foo.scala")) // true scalaSources.matches(Paths.get("foo/bar/baz/fizz/buzz/Bar.scala")) // true scalaSources.matches(Paths.get("foo/bar/baz/fizz/buzz/Baz.java")) // false
- relativeGlob
the RelativeGlob to be appended to the query
- returns
a Glob with the new RelativeGlob appended to the query.
-
def
/(regex: Regex): Glob
Appends a relative glob specified by a regex pattern to an existing Glob.
Appends a relative glob specified by a regex pattern to an existing Glob. For example:
val glob = Glob("foo/bar") val scalaSources = glob / "^[^.].*\\.scala".r scalaSources.matches(Paths.get("foo/bar/Foo.scala")) // true scalaSources.matches(Paths.get("foo/bar/.hidden.scala")) // false
Note that it is not possible to specify a recursive glob this way because
**
is not valid in regex. To make a recursive glob, combine with RecursiveGlob:val scalaSources = Glob("foo/bar") / ** / "^[^.].*\\.scala".r scalaSources.matches(Paths.get("foo/bar/baz/fizz/buzz/Foo.scala")) // true scalaSources.matches(Paths.get("foo/bar/baz/fizz/buzz/.hidden.scala")) // false
On Windows,
\
will be treated as a regex escape character but/
will be treated as a path separator.- regex
the pattern to apply
- returns
a Glob with the new RelativeGlob appended to the query.
-
def
/(relativeGlob: String): Glob
Appends a relative glob path to an existing Glob.
Appends a relative glob path to an existing Glob. For example:
val glob = Glob("foo/bar") val scalaSources = glob / "**<code>/</code>*.scala" scalaSources.matches(Paths.get("foo/bar/Foo.scala")) // true scalaSources.matches(Paths.get("foo/bar/baz/fizz/buzz/Bar.scala")) // true scalaSources.matches(Paths.get("foo/bar/baz/fizz/buzz/Baz.java")) // false
- relativeGlob
the string that will be parsed into a RelativeGlob and appended to the base glob
- returns
a Glob with the new RelativeGlob appended to the query.
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- val glob: Glob
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
toString(): String
- Definition Classes
- Any