X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.export.core%2Fscratch%2Forg%2Fsimantics%2Fexport%2Fcore%2FZipTest.java;fp=bundles%2Forg.simantics.export.core%2Fscratch%2Forg%2Fsimantics%2Fexport%2Fcore%2FZipTest.java;h=a257ebfbd4888928b320cc827d9aadee8a6edebb;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.export.core/scratch/org/simantics/export/core/ZipTest.java b/bundles/org.simantics.export.core/scratch/org/simantics/export/core/ZipTest.java new file mode 100644 index 000000000..a257ebfbd --- /dev/null +++ b/bundles/org.simantics.export.core/scratch/org/simantics/export/core/ZipTest.java @@ -0,0 +1,38 @@ +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(); + + } + +}