- 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
pattern
is a valid classpath resource, load the singleSource
from there - If
pattern
is a valid file on the file system, load the singleSource
from there - Match all files on the file system according to
pattern
(interpreted as an ant-style file pattern), and load all of theSource
items 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 interface
FilePattern.Loader
A callback interface that allows for loading aSource
.static class
FilePattern.Sort
The 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 File
basedir()
FilePattern
basedir(File newBasedir)
List<Source>
collect()
Retrieve a set ofSource
items from this pattern.String
encoding()
FilePattern
encoding(String newEncoding)
void
load(FilePattern.Loader loader)
Load a set ofSource
items from this pattern.String
pattern()
FilePattern
pattern(String newPattern)
FilePattern.Sort
sort()
FilePattern
sort(FilePattern.Sort newSort)
String
toString()
-
-
-
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 ofSource
items from this pattern.- Throws:
IOException
- if something goes wrong while loading file contents.
-
load
public final void load(FilePattern.Loader loader)
Load a set ofSource
items from this pattern.- Throws:
IOException
- if something goes wrong while loading file contents.
-
-