package file
- Alphabetic
- By Inheritance
- file
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
ChangedFiles(created: Seq[Path], deleted: Seq[Path], updated: Seq[Path]) extends Product with Serializable
Represents a set of possible file changes.
Represents a set of possible file changes.
- created
the files that are newly created
- deleted
the files that have been deleted
- updated
the files that have been updated
-
sealed
trait
FileAttributes extends AnyRef
Represents a minimal set of attributes a file.
Represents a minimal set of attributes a file. In contrast to
java.nio.file.attribute.BasicFileAttributes
, it is possible to compute the values provided by this trait without stating the file. If all of the methods return false, the user may infer that the file to which these attributes corresponds does not exist. An instance of this class may not represent that current state of the file if the underlying file has been modified since the instance was first created. -
trait
FileTreeView[+T] extends AnyRef
Provides a view into the file system that allows retrieval of the children of a particular path.
Provides a view into the file system that allows retrieval of the children of a particular path. Specific implementations may use native library on some platforms to speed up recursive file tree traversal.
- T
the type of object returned for each file
-
sealed
trait
Glob extends AnyRef
Represents a query for a path on the file system.
Represents a query for a path on the file system. Instances of
Glob
can be combined together to build a more complicated query. Similar to the path name components of aPath
, aGlob
has components and matching is done from left to right component-wise. Each component is matched using a PathMatcher. For example,val baseGlob = Glob("/foo/bar") baseGlob.matches(Paths.get("/foo/bar")) // true baseGlob.matches(Paths.get("/foo")) // false baseGlob.matches(Paths.get("/foo/bar/baz")) // false val children = baseGlob / AnyPath children.matches(Paths.get("/foo/bar")) // false children.matches(Paths.get("/foo/bar/baz")) // true children.matches(Paths.get("/foo/bar/baz/buzz")) false val secondGenerationChildren = children / AnyPath secondGeneration.matches(Paths.get("/foo/bar/baz")) // false secondGeneration.matches(Paths.get("/foo/bar/baz/buzz")) // true secondGeneration.matches(Paths.get("/foo/bar/baz/buzz/fizz")) // false
where AnyPath matches any path name.
Globs can be recursive and are constructed using the RecursiveGlob:
val baseGlob = Glob("/foo/bar") val allDescendants = baseGlob / RecursiveGlob allDescendants.matches(Paths.get("/foo/bar")) // false allDescendants.matches(Paths.get("/foo/bar/baz/buzz.txt")) // true
They can also filter on the basis file names:
val baseGlob = Glob("/foo/bar") val allScalaSources = baseGlob / RecursiveGlob / "*.scala" allScalaSources.matches(Paths.get("/foo/bar/Foo.scala")) // true allScalaSources.matches(Paths.get("/foo/bar/baz/fizz/buzz/Bar.scala")) // true allScalaSources.matches(Paths.get("/foo/bar/baz/fizz/buzz/Buzz.java")) // false val allScalaAndJavaSources = baseGlob / RecursiveGlob / "*.{java,scala}" allScalaAndJavaSources.matches(Paths.get("/foo/bar/baz/fizz/buzz/Bar.scala")) // true allScalaAndJavaSources.matches(Paths.get("/foo/bar/baz/fizz/buzz/Buzz.java")) // true
-
trait
PathFilter extends AnyRef
A filter for a path and its attributes.
-
sealed
trait
RelativeGlob extends Glob
A specialization of Glob that applies only to relative paths.
A specialization of Glob that applies only to relative paths. RelativeGlob instances can always be combined with the
/
operator whereas generalGlob
instances cannot because they may correspond to an absolute file path:val combined = Glob("/foo/bar") / RelativeGlob("
Value Members
- val *: AnyPath.type
- val **: RecursiveGlob.type
-
object
AnyPath extends SingleComponentMatcher with RelativeGlob with Product with Serializable
A RelativeGlob that matches any single path name.
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
- object FileAttributes
- object FileTreeView
- object Glob
- object PathFilter extends LowPriorityPathFilter
-
object
RecursiveGlob extends SingleComponentMatcher with RelativeGlob with Product with Serializable
A RelativeGlob that matches any path.
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
- object RelativeGlob