From 9fe0688ee51eeae607beb8392a7b77da4e0e505e Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Sat, 30 May 2020 11:08:33 -0400 Subject: [PATCH] Work on rework --- .../utilities/cache/CachingPackageClient.java | 15 +-------------- .../cache/FilesystemPackageCacheManager.java | 4 ++-- ...{BasePackageClient.java => PackageClient.java} | 4 ++-- 3 files changed, 5 insertions(+), 18 deletions(-) rename org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/{BasePackageClient.java => PackageClient.java} (98%) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/CachingPackageClient.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/CachingPackageClient.java index cdb1d66d6..571dd59c9 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/CachingPackageClient.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/CachingPackageClient.java @@ -2,32 +2,19 @@ package org.hl7.fhir.utilities.cache; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.ArrayList; -import java.util.Collections; import java.util.Date; import java.util.List; -import java.util.Set; -import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.VersionUtilities; -import org.hl7.fhir.utilities.json.JSONUtil; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; /** * Implementation of a package client that keeps a local disk cache of downloaded artifacts * in order to avoid re-downloading things */ -public class CachingPackageClient extends BasePackageClient { +public class CachingPackageClient extends PackageClient { private String cacheFolder; diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/FilesystemPackageCacheManager.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/FilesystemPackageCacheManager.java index 3d0e528b9..fff778f59 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/FilesystemPackageCacheManager.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/FilesystemPackageCacheManager.java @@ -201,8 +201,8 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple private void listSpecs(Map specList, String server) throws IOException { CachingPackageClient pc = new CachingPackageClient(server); - List matches = pc.search(null, null, null, false); - for (BasePackageClient.PackageInfo m : matches) { + List matches = pc.search(null, null, null, false); + for (PackageClient.PackageInfo m : matches) { if (!specList.containsKey(m.getId())) { specList.put(m.getId(), m.getUrl()); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/BasePackageClient.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/PackageClient.java similarity index 98% rename from org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/BasePackageClient.java rename to org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/PackageClient.java index da85dc16d..f384d2f2e 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/BasePackageClient.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/PackageClient.java @@ -22,7 +22,7 @@ import java.util.Date; import java.util.List; import java.util.Set; -public abstract class BasePackageClient { +public class PackageClient { public class PackageInfo { private String id; @@ -73,7 +73,7 @@ public abstract class BasePackageClient { private String cacheFolder; - public BasePackageClient(String address) { + public PackageClient(String address) { super(); this.address = address; try {