FileDocCategorySizeDatePackage
ZipTest.javaAPI DocExample1077Mon Jan 09 11:01:58 GMT 2006None

ZipTest

public class ZipTest extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        FileSystemView fsv = new ZipFileSystemView();
        JFileChooser chooser = new JFileChooser(".");
        chooser.setFileSystemView(fsv);
        chooser.showOpenDialog(null);
        File file = chooser.getSelectedFile();
        System.out.println("Got the file: " + file + " " + file.getClass());
        
        
        InputStream in = null;
        if(file instanceof ZipEntryFileProxy) {
            in = ((ZipEntryFileProxy)file).getInputStream();
        } else {
            in = new FileInputStream(file);
        }
        byte[] buf = new byte[1024];
        while(true) {
            int n = in.read(buf);
            if(n < 0) break;
            System.out.write(buf,0,n);
        }
        
        
        
        System.exit(0);
    
public static voidp(java.lang.String str)

        System.out.println(str);