scanDirectory now scans all subfolders
This commit is contained in:
parent
94feb31bef
commit
270a8bca71
|
@ -504,19 +504,21 @@ public class ValidationEngine {
|
|||
}
|
||||
|
||||
private Map<String, byte[]> scanDirectory(File f) throws FileNotFoundException, IOException {
|
||||
Map<String, byte[]> res = new HashMap<String, byte[]>();
|
||||
Map<String, byte[]> 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");
|
||||
|
||||
|
|
Loading…
Reference in New Issue