From 776811813e27e5ffc670333e36bcedbbac2157fd Mon Sep 17 00:00:00 2001 From: Vadim Peretokin Date: Sun, 7 Mar 2021 11:58:18 +0100 Subject: [PATCH] fix crash when folder is present in ig folder --- .../src/main/java/org/hl7/fhir/validation/IgLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java index 883e49d9a..d689da3a8 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java @@ -65,7 +65,7 @@ public class IgLoader { public void loadIg(List igs, Map binaries, - String src, + String src, boolean recursive) throws IOException, FHIRException { NpmPackage npm = src.matches(FilesystemPackageCacheManager.PACKAGE_VERSION_REGEX_OPT) && !new File(src).exists() ? getPackageCacheManager().loadPackage(src, null) : null; if (npm != null) { @@ -147,7 +147,7 @@ public class IgLoader { * @throws IOException **/ public Map loadIgSource(String src, - boolean recursive, + boolean recursive, boolean explore) throws FHIRException, IOException { // src can be one of the following: // - a canonical url for an ig - this will be converted to a package id and loaded into the cache @@ -562,7 +562,7 @@ public class IgLoader { for (File ff : f.listFiles()) { if (ff.isDirectory() && recursive) { res.putAll(scanDirectory(ff, true)); - } else if (!isIgnoreFile(ff)) { + } else if (!ff.isDirectory() && !isIgnoreFile(ff)) { Manager.FhirFormat fmt = ResourceChecker.checkIsResource(getContext(), isDebug(), ff.getAbsolutePath()); if (fmt != null) { res.put(Utilities.changeFileExt(ff.getName(), "." + fmt.getExtension()), TextFile.fileToBytes(ff.getAbsolutePath()));