]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.export.core/scratch/org/simantics/export/core/ZipTest.java
StyleBase runs cleanup in wrong thread
[simantics/platform.git] / bundles / org.simantics.export.core / scratch / org / simantics / export / core / ZipTest.java
1 package org.simantics.export.core;
2
3 import java.io.FileInputStream;
4 import java.io.FileOutputStream;
5 import java.util.zip.ZipEntry;
6 import java.util.zip.ZipOutputStream;
7
8 import org.simantics.databoard.util.StreamUtil;
9
10 public class ZipTest {
11         
12         public static void main(String[] args) throws Exception {
13                 
14           FileOutputStream fos = new FileOutputStream("C:/scratch/case1_h_example.zip");
15           ZipOutputStream zos = new ZipOutputStream(fos);
16
17           FileInputStream fis1 = new FileInputStream("C:/scratch/case1_h.pdf");
18           try {
19               zos.putNextEntry(new ZipEntry("case1_h.pdf"));
20               StreamUtil.copyStream(fis1, zos);
21               zos.closeEntry();
22           } finally {
23               fis1.close();
24           }
25       
26           FileInputStream fis2 = new FileInputStream("C:/scratch/VF62.aprosDiagram");
27           try {
28               zos.putNextEntry(new ZipEntry("VF62.aprosDiagram"));
29               StreamUtil.copyStream(fis2, zos);
30               zos.closeEntry();
31           } finally {
32               fis2.close();
33           }
34       zos.close();
35                 
36         }
37
38 }