SourceFiles
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SourceFiles.type
Members list
Value members
Concrete methods
Determines a sorted list of file paths in a directory that match the specified criteria.
Determines a sorted list of file paths in a directory that match the specified criteria.
Value parameters
- ignoredDefaultRegex
-
An optional sequence of regular expressions for default files to ignore.
- ignoredFilesPath
-
An optional sequence of specific file paths to ignore.
- ignoredFilesRegex
-
An optional regular expression for additional files to ignore.
- inputPath
-
The root directory to search for files.
- sourceFileExtensions
-
A set of file extensions to include in the search.
- visitOptions
-
Implicit parameter defining the options for visiting the file tree. Defaults to
VisitOptions.follow
, which follows symbolic links.
Attributes
- Returns
-
A sorted
List[String]
of file paths matching the criteria. This function traverses the file tree starting at the giveninputPath
and collects file paths that:- Have extensions specified in
sourceFileExtensions
. - Are not ignored based on
ignoredDefaultRegex
,ignoredFilesRegex
, orignoredFilesPath
. It uses a customFailsafeFileVisitor
to handle the filtering logic andFiles.walkFileTree
to perform the traversal. Example usage:
val files = determine( inputPath = "/path/to/dir", sourceFileExtensions = Set(".scala", ".java"), ignoredDefaultRegex = Some(Seq(".*\\.tmp".r)), ignoredFilesRegex = Some(".*_backup\\.scala".r), ignoredFilesPath = Some(Seq("/path/to/dir/ignore_me.scala")) ) println(files)
- Have extensions specified in
- Throws
-
java.io.FileNotFoundException
if the
inputPath
does not exist or is not readable. - See also
-
FailsafeFileVisitor for details on the visitor used to process files.
Filters a file based on the provided ignore rules.
Filters a file based on the provided ignore rules.
This method determines whether a given file should be excluded from processing based on several criteria, such as matching default ignore patterns, specific file name patterns, or explicit file paths to ignore.
Value parameters
- file
-
The file name or path to evaluate.
- ignoredDefaultRegex
-
Optional sequence of regular expressions defining default file patterns to ignore.
- ignoredFilesPath
-
Optional sequence of file paths to explicitly exclude.
- ignoredFilesRegex
-
Optional regular expression defining specific file name patterns to ignore.
- inputPath
-
The root input path for the file traversal.
Attributes
- Returns
-
true
if the file is accepted, i.e., does not match any of the ignore criteria,false
otherwise.
Filters a list of files based on the provided ignore rules.
Filters a list of files based on the provided ignore rules.
This method applies filterFile to each file in the input list, returning only those files that do not match any of the ignore criteria.
Value parameters
- files
-
The list of file names or paths to evaluate.
- ignoredDefaultRegex
-
Optional sequence of regular expressions defining default file patterns to ignore.
- ignoredFilesPath
-
Optional sequence of file paths to explicitly exclude.
- ignoredFilesRegex
-
Optional regular expression defining specific file name patterns to ignore.
- inputPath
-
The root input path for the file traversal.
Attributes
- Returns
-
A filtered list of files that do not match the ignore criteria.
Constructs an absolute path against rootPath. If the given path is already absolute this path is returned unaltered. Otherwise, "rootPath / path" is returned.
Constructs an absolute path against rootPath. If the given path is already absolute this path is returned unaltered. Otherwise, "rootPath / path" is returned.
Attributes
Constructs a relative path against rootPath. If the given path is not inside rootPath, path is returned unaltered. Otherwise, the path relative to rootPath is returned.
Constructs a relative path against rootPath. If the given path is not inside rootPath, path is returned unaltered. Otherwise, the path relative to rootPath is returned.