RecursiveGlob

sbt.nio.file.RecursiveGlob
case object RecursiveGlob extends RelativeGlob

A RelativeGlob that matches any path. Can be combined with other Glob instances to build recursive queries:

 val scalaSources = Glob("/foo/bar") / RecursiveGlob / "*.scala"
 scalaSources.matches(Paths.get("/foo/bar/Foo.scala")) // true
 scalaSources.matches(Paths.get("/foo/bar/baz/fizz/buzz/Bar.scala")) // true

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait RelativeGlob
trait Glob
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Inherited types

type MirroredElemLabels = EmptyTuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Singleton
type MirroredElemTypes = EmptyTuple

Attributes

Inherited from:
Singleton
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
type MirroredMonoType = Singleton.this.type

The mirrored *-type

The mirrored *-type

Attributes

Inherited from:
Singleton
type MirroredType = Singleton.this.type

Attributes

Inherited from:
Singleton

Value members

Concrete methods

def matches(path: Path): Boolean

Indicates whether a path matches the pattern specified by this Glob.

Indicates whether a path matches the pattern specified by this Glob.

Value parameters

path

the path to match

Attributes

Returns

true it the path matches.

Inherited methods

def /(regex: Regex): RelativeGlob

Appends a relative glob specified by a regex pattern to an existing Glob. For example:

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.

Value parameters

regex

the pattern to apply

Attributes

Returns

a Glob with the new RelativeGlob appended to the query.

Inherited from:
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

Value parameters

relativeGlob

the additional query string to parse and append

Attributes

Returns

a Glob with the new RelativeGlob appended to the query.

Inherited from:
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

Value parameters

relativeGlob

the additional query string to parse and append

Attributes

Returns

a Glob with the new RelativeGlob appended to the query.

Inherited from:
RelativeGlob
def fromProduct(p: Product): MirroredMonoType

Create a new instance of type T with elements taken from product p.

Create a new instance of type T with elements taken from product p.

Attributes

Inherited from:
Singleton
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
override def toString: String

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
SingleComponentMatcher -> Any
Inherited from:
SingleComponentMatcher (hidden)