diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/TextFile.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/TextFile.java index ad6ea9484..9e91854b7 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/TextFile.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/TextFile.java @@ -161,7 +161,11 @@ public class TextFile { } public static String fileToString(String src) throws FileNotFoundException, IOException { - FileInputStream fs = new FileInputStream(new CSFile(src)); + CSFile f = new CSFile(src); + if (!f.exists()) { + throw new IOException("File "+src+" not found"); + } + FileInputStream fs = new FileInputStream(f); try { return streamToString(fs); } finally { diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageList.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageList.java index bc555c712..53727f47c 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageList.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageList.java @@ -351,5 +351,14 @@ public class PackageList { return list; } + public boolean hasPath(String pathVer) { + for (PackageListEntry t : versions) { + if (t.path() != null && t.path().equals(pathVer)) { + return true; + } + } + return false; + } + }