Work on rework

This commit is contained in:
jamesagnew 2020-05-30 11:08:33 -04:00
parent c0f6366626
commit 9fe0688ee5
3 changed files with 5 additions and 18 deletions

View File

@ -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;

View File

@ -201,8 +201,8 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
private void listSpecs(Map<String, String> specList, String server) throws IOException {
CachingPackageClient pc = new CachingPackageClient(server);
List<BasePackageClient.PackageInfo> matches = pc.search(null, null, null, false);
for (BasePackageClient.PackageInfo m : matches) {
List<PackageClient.PackageInfo> matches = pc.search(null, null, null, false);
for (PackageClient.PackageInfo m : matches) {
if (!specList.containsKey(m.getId())) {
specList.put(m.getId(), m.getUrl());
}

View File

@ -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 {