use of org.hl7.fhir.utilities.CloseProtectedZipInputStream in project kindling by HL7.
the class Publisher method minify.
private void minify(String srcFile, String dstFile) throws Exception {
CloseProtectedZipInputStream source = new CloseProtectedZipInputStream(new FileInputStream(srcFile));
ZipGenerator dest = new ZipGenerator(dstFile);
ZipEntry entry = null;
while ((entry = source.getNextEntry()) != null) {
String name = entry.getName();
if (name.endsWith(".xsd"))
dest.addStream(entry.getName(), stripXsd(source), false);
else if (name.endsWith(".json") && !name.endsWith(".schema.json"))
dest.addStream(entry.getName(), stripJson(source), false);
else if (name.endsWith(".xml"))
dest.addStream(entry.getName(), stripXml(source), false);
else
dest.addStream(entry.getName(), source, false);
}
source.actualClose();
dest.close();
}
Aggregations