From 12b0046ebc16bf8c333deaff5667c34a14384d2d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 18 May 2020 06:21:13 +1000 Subject: [PATCH] get current core pacakge from current build --- .../fhir/utilities/cache/PackageCacheManager.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/PackageCacheManager.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/PackageCacheManager.java index 0ddd70115..c35172733 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/PackageCacheManager.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/PackageCacheManager.java @@ -257,7 +257,15 @@ public class PackageCacheManager { for (File f : new File(cacheFolder).listFiles()) { if (f.isDirectory()) { Utilities.clearDirectory(f.getAbsolutePath()); + try { FileUtils.deleteDirectory(f); + } catch (Exception e1) { + try { + FileUtils.deleteDirectory(f); + } catch (Exception e2) { + // just give up + } + } } else if (!f.getName().equals("packages.ini")) FileUtils.forceDelete(f); @@ -652,8 +660,8 @@ public class PackageCacheManager { InputStream stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "package.tgz"), false); return new InputStreamWithSrc(stream, Utilities.pathURL(ciList.get(id), "package.tgz"), "current"); } else if (id.startsWith("hl7.fhir.r5")) { - InputStream stream = fetchFromUrlSpecific(Utilities.pathURL("http://hl7.org/fhir/2020Feb", id+".tgz"), false); - return new InputStreamWithSrc(stream, Utilities.pathURL("http://hl7.org/fhir/2020Feb", id+".tgz"), "current"); + InputStream stream = fetchFromUrlSpecific(Utilities.pathURL("http://build.fhir.org", id+".tgz"), false); + return new InputStreamWithSrc(stream, Utilities.pathURL("http://build.fhir.org", id+".tgz"), "current"); } else { throw new FHIRException("The package '"+id+"' has not entry on the current build server"); }