Packages

implicit final class Ops extends AnyVal

Adds additional methods to FileTreeView. This api may be changed so it should not be imported directly.

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

Instance Constructors

  1. new Ops(fileTreeView: Nio[FileAttributes])

    fileTreeView

    the FileTreeView to augment.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. val fileTreeView: Nio[FileAttributes]
  6. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  7. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  8. def iterator(globs: Traversable[Glob], filter: PathFilter): Iterator[(Path, FileAttributes)]

    Returns a filtered of the existing paths on the file system that match the Glob pattern.

    Returns a filtered of the existing paths on the file system that match the Glob pattern. It should not throw an IOException and will return an empty sequence if no paths exist that match the patterns. It will print a warning if any of the globs do not have an absolute base path but it will expand the glob to Paths.get("").toGlob / glob for traversal. It optimizes traversal so that each directory on the file system is only listed once:

     val dir = Paths.get("").toAbsolutePath.toGlob
     // This only lists the current directory once
     val view = FileTreeView.default
     val filter: (Path, FileAttributes) => Boolean = (_, a) => a.isRegularFile
     view.iterator(Seq(dir / "*.scala", dir / "*.java"), filter).foreach {
      case (path, attributes) => println(s"path: $$path, attributes: $$attributes")
    }
     // This lists the current directory twice
     (view.iterator(dir / "*.scala", filter) ++ view.iterator(dir / "*.java"), filter).foreach {
      case (path, attributes) => println(s"path: $$path, attributes: $$attributes")
    }
    globs

    the search queries

    filter

    the pathfilter

    returns

    all of the paths that match the search query.

  9. def iterator(globs: Traversable[Glob]): Iterator[(Path, FileAttributes)]

    Returns all of the existing paths on the file system that match the Glob pattern.

    Returns all of the existing paths on the file system that match the Glob pattern. It should not throw an IOException and will return an empty sequence if no paths exist tha match the patterns. It will print a warning if any of the globs do not have an absolute base path but it will expand the glob to Paths.get("").toGlob / glob for traversal. It optimizes traversal so that each directory on the file system is only listed once:

     val dir = Paths.get("").toAbsolutePath.toGlob
     // This only lists the current directory once
     val view = FileTreeView.default
     view.iterator(Seq(dir / "*.scala", dir / "*.java")).foreach {
      case (path: Path, attributes: FileAttributes) =>
        println(s"path: $$path, attributes: $$attributes")
    }
     // This lists the current directory twice
     (view.iterator(dir / "*.scala") ++ view.iterator(dir / "*.java")) .foreach {
      case (path, attributes) => println(s"path: $$path, attributes: $$attributes")
    }
    globs

    the search queries

    returns

    all of the paths that match the search query.

  10. def iterator(glob: Glob, filter: PathFilter): Iterator[(Path, FileAttributes)]

    Returns a filtered iterator for all of the existing paths on the file system that match the Glob pattern.

    Returns a filtered iterator for all of the existing paths on the file system that match the Glob pattern. It should not throw an IOException and will return an empty sequence if no paths exist that match the pattern and the filter. It will print a warning if the glob does not have an absolute base path but it will expand the glob to Paths.get("").toAbsolutePath.toGlob / glob for traversal.

    val dir = Paths.get("").toAbsolutePath.toGlob
    val regularNonHiddenFiles = FileTreeView.default.list(dir / "*.scala",
     (p: Path, a: FileAttributes) => a.isRegularFile && !Files.isHidden(p) )
    glob

    the search query

    filter

    the filter for the path name and attributes of each file in the result set

    returns

    an iterator for all of the paths that match the search query.

  11. def iterator(glob: Glob): Iterator[(Path, FileAttributes)]

    Returns an iterator for all of the existing paths on the file system that match the Glob pattern.

    Returns an iterator for all of the existing paths on the file system that match the Glob pattern. It should not throw an IOException and will return an empty sequence if no paths exist that match the pattern. It will print a warning if the glob does not have an absolute base path but it will expand the glob to Paths.get("").toAbsolutePath.toGlob / glob for traversal.

    glob

    the search query

    returns

    an iterator for all of the paths that match the search query.

  12. def list(globs: Traversable[Glob], filter: PathFilter): Seq[(Path, FileAttributes)]

    Returns a filtered list of the existing paths on the file system that match the Glob pattern.

    Returns a filtered list of the existing paths on the file system that match the Glob pattern. It should not throw an IOException and will return an empty sequence if no paths exist that match the patterns and filter. It will print a warning if any of the globs do not have an absolute base path but it will expand the glob to Paths.get("").toGlob / glob for traversal. It optimizes traversal so that each directory on the file system is only listed once:

    val dir = Paths.get("").toAbsolutePath.toGlob
    // This only lists the current directory once
    val view = FileTreeView.default
    val filter: (Path, FileAttributes) = (_, a) => a.isRegularFile
    val sources = view.list(Seq(dir / "*.scala", dir / "*.java"), filter)
    // This lists the current directory twice
    val slowSources =
      view.list(dir / "*.scala", filter) ++ view.list(current / "*.java", filter)
    globs

    the search queries

    filter

    the filter for the path name and attributes of each file in the result set

    returns

    all of the paths that match the search query.

  13. def list(globs: Traversable[Glob]): Seq[(Path, FileAttributes)]

    Returns all of the existing paths on the file system that match the Glob pattern.

    Returns all of the existing paths on the file system that match the Glob pattern. This method should not throw and will return an empty sequence if no paths exist that match the patterns. It will print a warning if any of the globs do not have an absolute base path but it will expand the glob to Paths.get("").toGlob / glob for traversal. It optimizes traversal so that each directory on the file system is only listed once:

    val dir = Paths.get("").toAbsolutePath.toGlob
    // This only lists the current directory once
    val view = FileTreeView.default
    val sources = view.list(Seq(dir / "*.scala", dir / "*.java"))
    // This lists the current directory twice
    val slowSources = view.list(dir / "*.scala") ++ view.list(current / "*.java")
    globs

    the search queries

    returns

    all of the paths that match the search query.

  14. def list(glob: Glob, filter: PathFilter): Seq[(Path, FileAttributes)]

    Returns a filtered list of the existing paths on the file system that match the Glob pattern.

    Returns a filtered list of the existing paths on the file system that match the Glob pattern. It should not throw an IOException and will return an empty sequence if no paths exist that match the patterns and filter. It will print a warning if any of the globs do not have an absolute base path but it will expand the glob to Paths.get("").toGlob / glob for traversal.

    glob

    the search query

    filter

    the filter for the path name and attributes of each file in the result set

    returns

    all of the paths that match the search query.

  15. def list(glob: Glob): Seq[(Path, FileAttributes)]

    Returns all of the existing paths on the file system that match the Glob pattern.

    Returns all of the existing paths on the file system that match the Glob pattern. It should not throw an IOException and will return an empty sequence if no paths exist that match the pattern. It will print a warning if the glob does not have an absolute base path but it will expand the glob to Paths.get("").toAbsolutePath.toGlob / glob for traversal.

    glob

    the search query

    returns

    all of the paths that match the search query.

  16. def toString(): String
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped