+ static Collection<File> listFiles(File root, File[] excludedFiles, Log log) throws FileNotFoundException {
+ if (!root.exists()) {
+ throw new FileNotFoundException(root.toString());
+ }
+ Collection<File> result = new ArrayList<>();
+ Collection<File> yangFiles = FileUtils.listFiles(root, new String[] { YANG_SUFFIX }, true);
+ for (File f : yangFiles) {
+ boolean excluded = false;
+ for (File ex : excludedFiles) {
+ if (ex.equals(f)) {
+ excluded = true;
+ break;
+ }
+ }
+ if (excluded) {
+ if(log != null) {
+ log.info(Util.message("%s file excluded %s", YangToSourcesProcessor.LOG_PREFIX,
+ Util.YANG_SUFFIX.toUpperCase(), f));
+ }
+ } else {
+ result.add(f);
+ }
+ }
+
+ return result;
+ }
+
+ static List<InputStream> listFilesAsStream(File rootDir, File[] excludedFiles, Log log)