From 5d1cf89db535d9324a3d8bac33686e88bc67539e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 31 Jan 2020 08:19:51 +1100 Subject: [PATCH] add more package maintenance features --- .../hl7/fhir/utilities/cache/NpmPackage.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java index e3ae236b8..ed14e3f35 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/cache/NpmPackage.java @@ -756,5 +756,23 @@ public class NpmPackage { Collections.sort(res); return res ; } + + public void clearFolder(String folderName) { + NpmPackageFolder folder = folders.get(folderName); + folder.content.clear(); + folder.types.clear(); + } + + public void deleteFolder(String folderName) { + folders.remove(folderName); + } + + public void addFile(String folderName, String name, byte[] cnt, String type) { + NpmPackageFolder folder = folders.get(folderName); + folder.content.put(name, cnt); + if (!folder.types.containsKey(type)) + folder.types.put(type, new ArrayList<>()); + folder.types.get(type).add(name); + } }