Class Sources
java.lang.Object
com.vaadin.swingbridge.migration.tool.Sources
The source-tree walk the tools run: every file under a root matching a glob, build output pruned.
Sources.under(Path.of("src/main/java"), "*.java");
Sources.under(Path.of("src/main/resources"), "*.{html,htm}");
The glob matches the file name, not the path, so *.java means what a migrator
reading the invocation expects it to mean.
Lives in com.vaadin.swingbridge.migration.tool rather than in any tool's package because more than one tool
uses it — that is the whole membership rule for this package. A class only one tool uses belongs in that
tool's package, however generic it looks: Lexed, a Java-source lexer, sits in
importswap for exactly that reason.
public only so the tool subpackages can reach it; jar-internal like everything
else here, and not part of any surface a migrator calls.
-
Method Summary
-
Method Details
-
under
- Parameters:
root- a directory to walk, or a single file to take as-isglob- matched against each file name, inFileSystems.getDefault()glob syntax- Returns:
- the matching files, sorted; empty when the root does not exist
- Throws:
IOException
-
missing
The roots that name nothing — neither a file nor a directory — in argument order.under(Path, String)reads such a root as empty, which is right for an app that genuinely has nosrc/main/resources; this is how a tool tells that apart from a typo and says so.
-