use of org.hl7.fhir.utilities.Utilities in project org.hl7.fhir.core by hapifhir.
the class FilesystemPackageCacheManager method removePackage.
// ========================= Utilities ============================================================================
/**
* Remove a particular package from the cache
*
* @param id
* @param ver
* @throws IOException
*/
public void removePackage(String id, String ver) throws IOException {
new CacheLock(id + "#" + ver).doWithLock(() -> {
String f = Utilities.path(cacheFolder, id + "#" + ver);
File ff = new File(f);
if (ff.exists()) {
Utilities.clearDirectory(f);
IniFile ini = new IniFile(Utilities.path(cacheFolder, "packages.ini"));
ini.removeProperty("packages", id + "#" + ver);
ini.save();
ff.delete();
}
return null;
});
}
Aggregations