diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/ValidationEngine.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/ValidationEngine.java index d3167299c..ca34cb4f2 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/ValidationEngine.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/ValidationEngine.java @@ -506,19 +506,21 @@ public class ValidationEngine { } private Map scanDirectory(File f) throws FileNotFoundException, IOException { - Map res = new HashMap(); + Map res = new HashMap<>(); for (File ff : f.listFiles()) { - if (!isIgnoreFile(ff) && !ff.isDirectory()) { - FhirFormat fmt = checkIsResource(ff.getAbsolutePath()); - if (fmt != null) { - res.put(Utilities.changeFileExt(ff.getName(), "."+fmt.getExtension()), TextFile.fileToBytes(ff.getAbsolutePath())); + if (ff.isDirectory()){ + res.putAll(scanDirectory(ff)); + } + else if (!isIgnoreFile(ff)) { + FhirFormat fmt = checkIsResource(ff.getAbsolutePath()); + if (fmt != null) { + res.put(Utilities.changeFileExt(ff.getName(), "."+fmt.getExtension()), TextFile.fileToBytes(ff.getAbsolutePath())); + } } - } } return res; } - private boolean isIgnoreFile(File ff) { return Utilities.existsInList(ff.getName(), ".DS_Store") || Utilities.existsInList(Utilities.getFileExtension(ff.getName()).toLowerCase(), "md", "css", "js", "png", "gif", "jpg", "html", "tgz", "pack", "zip");