Class ExclusionMatcher
java.lang.Object
io.github.sergeloie.languagecheck.scan.ExclusionMatcher
Decides whether a file or directory is excluded from a scan.
Three independent rules:
excludedFiles- exact match on the normalized relative path.excludedDirs- directory-name match at any depth: a path is excluded when one of its path segments equals the entry, sobuild/excludes bothbuild/...andmodule/build/.... Also used by walkers to prune traversal.excludedExtensions- case-insensitive match on the file extension (dot stripped).
All paths are normalized to '/' separators; directory entries keep no
trailing slash; extension entries are lower-cased. null entries in
the input sets are ignored.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextensionOf(String relPath) Lower-cased file extension of a relative path, without the dot.booleanisExcludedDir(String relPath) True if the directory at the normalized relative pathrelPathis named like an excluded directory (any path segment matches).booleanisExcludedFile(String relPath) True if the file at the normalized relative pathrelPathmust be skipped: exact file match, a directory-name match at any depth, or an excluded extension.static ExclusionMatchernone()A matcher that excludes nothing.
-
Constructor Details
-
ExclusionMatcher
-
-
Method Details
-
none
A matcher that excludes nothing. -
isExcludedFile
True if the file at the normalized relative pathrelPathmust be skipped: exact file match, a directory-name match at any depth, or an excluded extension. -
isExcludedDir
True if the directory at the normalized relative pathrelPathis named like an excluded directory (any path segment matches). Used by walkers to prune whole subtrees. -
extensionOf
Lower-cased file extension of a relative path, without the dot. Returns""for files without an extension and for dot-files such as.gitignore.
-