Ops

final implicit
class Ops(val fileTreeView: Nio[FileAttributes]) extends AnyVal

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

Value Params
fileTreeView

the FileTreeView to augment.

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

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

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.

Value Params
glob

the search query

Returns

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

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

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) )
Value Params
filter

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

glob

the search query

Returns

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

def iterator(globs: Iterable[Glob]): Iterator[(Path, FileAttributes)]

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:

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")
}
Value Params
globs

the search queries

Returns

all of the paths that match the search query.

def iterator(globs: Iterable[Glob], filter: PathFilter): Iterator[(Path, FileAttributes)]

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:

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")
}
Value Params
filter

the pathfilter

globs

the search queries

Returns

all of the paths that match the search query.

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

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.

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.

Value Params
glob

the search query

Returns

all of the paths that match the search query.

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

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.

Value Params
filter

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

glob

the search query

Returns

all of the paths that match the search query.

def list(globs: Iterable[Glob]): Seq[(Path, FileAttributes)]

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:

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")
Value Params
globs

the search queries

Returns

all of the paths that match the search query.

def list(globs: Iterable[Glob], filter: PathFilter): Seq[(Path, FileAttributes)]

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:

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)
Value Params
filter

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

globs

the search queries

Returns

all of the paths that match the search query.

Concrete fields