case object AnyPath extends SingleComponentMatcher with RelativeGlob with Product with Serializable
A RelativeGlob that matches any single path name.
AnyPath.matches(Paths.get("foo")) // true AnyPath.matches(Paths.get("foo/bar")) // false Glob("foo/bar", AnyPath).matches(Paths.get("foo/bar")) // false Glob("foo/bar", AnyPath).matches(Paths.get("foo/bar/baz")) // true Glob("foo/bar", AnyPath).matches(Paths.get("foo/bar/baz/buzz")) // false
It can be used to specify the minimum depth of a query:
val childScalaSources = Glob("/foo/bar") / AnyPath / RecursiveGlob / "*.scala" childScalaSources.matches(Paths.get("/foo/bar/Foo.scala")) // false childScalaSources.matches(Paths.get("/foo/bar/baz/Bar.scala")) // true childScalaSources.matches(Paths.get("/foo/bar/baz/fizz/buzz/Bar.scala")) // true
- Alphabetic
- By Inheritance
- AnyPath
- Serializable
- Product
- Equals
- SingleComponentMatcher
- Matcher
- RelativeGlob
- Glob
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def /(regex: Regex): RelativeGlob
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.
- Definition Classes
- RelativeGlob
- def /(relativeGlob: RelativeGlob): RelativeGlob
Appends an additional RelativeGlob to this RelativeGlob:
Appends an additional RelativeGlob to this RelativeGlob:
val glob = Glob("foo/bar") val scalaSources = glob / ** / "*.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 additional query string to parse and append
- returns
a Glob with the new RelativeGlob appended to the query.
- Definition Classes
- RelativeGlob
- def /(relativeGlob: String): RelativeGlob
Appends additional components to this RelativeGlob:
Appends additional components to this RelativeGlob:
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 additional query string to parse and append
- returns
a Glob with the new RelativeGlob appended to the query.
- Definition Classes
- RelativeGlob
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def matches(path: Path): Boolean
Indicates whether a path matches the pattern specified by this Glob.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementName(n: Int): String
- Definition Classes
- Product
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- SingleComponentMatcher → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()