/** Same as getFiles(pathFromRoot, suffix, false) */ default List<NamedReader> getFiles(Path pathFromRoot, String suffix) { return getFiles(pathFromRoot,suffix,false); }
/** Does {@link #getFiles} on the query profile directory and gets all xml files */ default List<NamedReader> getQueryProfileTypeFiles() { return getFiles(QUERY_PROFILE_TYPES_DIR,".xml"); }
/** Does {@link #getFiles} on the query profile directory and gets all xml files */ default List<NamedReader> getQueryProfileFiles() { return getFiles(QUERY_PROFILES_DIR,".xml"); }
/** Does {@link #getFiles} on the page template directory and gets all xml files */ default List<NamedReader> getPageTemplateFiles() { return getFiles(PAGE_TEMPLATES_DIR,".xml"); }
/** Build the set of semantic rules for an application package */ public SemanticRules build(ApplicationPackage applicationPackage) { List<NamedReader> ruleBaseFiles = null; try { ruleBaseFiles = applicationPackage.getFiles(ApplicationPackage.RULES_DIR, "sr"); return new SemanticRules(ruleBaseFiles.stream().map(this::toRuleBaseConfigView).collect(Collectors.toList())); } finally { NamedReader.closeAll(ruleBaseFiles); } }
/** * @return The root element of each xml file under pathFromAppRoot/ in the app package */ @NonNull public static List<Element> allElemsFromPath(ApplicationPackage app, String pathFromAppRoot) { List<Element> ret = new ArrayList<>(); List<NamedReader> files = null; try { files = app.getFiles(Path.fromString(pathFromAppRoot), ".xml", true); for (NamedReader reader : files) ret.add(getElement(reader)); } finally { NamedReader.closeAll(files); } return ret; }
public void checkIncludedDirs(ApplicationPackage app) throws IOException { for (String includedDir : app.getUserIncludeDirs()) { List<NamedReader> includedFiles = app.getFiles(Path.fromString(includedDir), ".xml", true); for (NamedReader file : includedFiles) { validators.containerIncludeXmlValidator().validate(file); } } }