package org.simantics.export.core; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.simantics.databoard.util.StreamUtil; public class ZipTest { public static void main(String[] args) throws Exception { FileOutputStream fos = new FileOutputStream("C:/scratch/case1_h_example.zip"); ZipOutputStream zos = new ZipOutputStream(fos); FileInputStream fis1 = new FileInputStream("C:/scratch/case1_h.pdf"); try { zos.putNextEntry(new ZipEntry("case1_h.pdf")); StreamUtil.copyStream(fis1, zos); zos.closeEntry(); } finally { fis1.close(); } FileInputStream fis2 = new FileInputStream("C:/scratch/VF62.aprosDiagram"); try { zos.putNextEntry(new ZipEntry("VF62.aprosDiagram")); StreamUtil.copyStream(fis2, zos); zos.closeEntry(); } finally { fis2.close(); } zos.close(); } }