Packages

p

sbt.nio

file

package file

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. file
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. 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

  2. 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.

  3. 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

  4. 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 a Path, a Glob 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
  5. trait PathFilter extends AnyRef

    A filter for a path and its attributes.

  6. 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 general Glob instances cannot because they may correspond to an absolute file path:

    val combined = Glob("/foo/bar") / RelativeGlob("

Value Members

  1. val *: AnyPath.type
  2. val **: RecursiveGlob.type
  3. 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
  4. object FileAttributes
  5. object FileTreeView
  6. object Glob
  7. object PathFilter extends LowPriorityPathFilter
  8. 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
  9. object RelativeGlob

Inherited from AnyRef

Inherited from Any

Ungrouped