public class SchemaFinder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_INCLUDE_PATTERN |
static boolean |
DEFAULT_RECURSIVE |
Constructor and Description |
---|
SchemaFinder(java.nio.file.Path rootDir)
Creates a new SchemaFinder with the given directory as root of the search.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
findSchemas()
Walks the directory tree starting at the root provided in the constructor to find GraphQL schemas.
|
void |
setExcludedFiles(java.util.Set<java.lang.String> excludedFiles)
Sets a set of paths to exclude from the search even if they match the include pattern.
|
void |
setIncludePattern(java.lang.String includePattern)
Sets the pattern that filenames should match to be included in the result.
|
void |
setRecursive(boolean recursive)
Sets whether this finder should recursively search in nested directories.
|
public static final java.lang.String DEFAULT_INCLUDE_PATTERN
public static final boolean DEFAULT_RECURSIVE
public SchemaFinder(java.nio.file.Path rootDir)
rootDir
- the starting directory of the search. Must not be null.public void setRecursive(boolean recursive)
recursive
- whether the file search should be recursivepublic void setIncludePattern(java.lang.String includePattern)
includePattern
- a regular expression pattern as defined by the Pattern
classsetExcludedFiles(Set)
public void setExcludedFiles(java.util.Set<java.lang.String> excludedFiles)
excludedFiles
- a set of exact file paths to exclude from the searchsetIncludePattern(String)
public java.util.List<java.lang.String> findSchemas() throws java.io.IOException
java.io.IOException
- if any I/O error occurs while reading the file system