- java.lang.Object
-
- org.jooq.FilePattern
-
@Internal public final class FilePattern extends Object
A utility class that can traverse a directory structure given some ant-style file patterns, or classpath resources.The following algorithm is applied when traversing sources:
- If
patternis a valid classpath resource, load the singleSourcefrom there - If
patternis a valid file on the file system, load the singleSourcefrom there - Match all files on the file system according to
pattern(interpreted as an ant-style file pattern), and load all of theSourceitems givensort(). An example pattern issrc/main/resources/**/*.sql
This is INTERNAL API. Please do not use directly as API may change incompatibly.
- Author:
- Lukas Eder
- If
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFilePattern.LoaderA callback interface that allows for loading aSource.static classFilePattern.SortThe sort algorithm to be applied to directory contents.
-
Constructor Summary
Constructors Constructor Description FilePattern()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Filebasedir()FilePatternbasedir(File newBasedir)List<Source>collect()Retrieve a set ofSourceitems from this pattern.Stringencoding()FilePatternencoding(String newEncoding)voidload(FilePattern.Loader loader)Load a set ofSourceitems from this pattern.Stringpattern()FilePatternpattern(String newPattern)FilePattern.Sortsort()FilePatternsort(FilePattern.Sort newSort)StringtoString()
-
-
-
Method Detail
-
sort
public final FilePattern.Sort sort()
-
sort
public final FilePattern sort(FilePattern.Sort newSort)
-
basedir
public final File basedir()
-
basedir
public final FilePattern basedir(File newBasedir)
-
pattern
public final String pattern()
-
pattern
public final FilePattern pattern(String newPattern)
-
encoding
public final String encoding()
-
encoding
public final FilePattern encoding(String newEncoding)
-
collect
public final List<Source> collect()
Retrieve a set ofSourceitems from this pattern.- Throws:
IOException- if something goes wrong while loading file contents.
-
load
public final void load(FilePattern.Loader loader)
Load a set ofSourceitems from this pattern.- Throws:
IOException- if something goes wrong while loading file contents.
-
-