FileDocCategorySizeDatePackage
Unzipper.javaAPI DocExample631Fri Feb 10 13:01:24 GMT 2006None

Unzipper

public class Unzipper extends Object

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

    ZipFile zf = new ZipFile(args[0]);
    Enumeration e = zf.entries();
    while (e.hasMoreElements()) {
      ZipEntry ze = (ZipEntry) e.nextElement();
      System.out.println("Unzipping " + ze.getName());
      FileOutputStream fout = new FileOutputStream(ze.getName());
      InputStream in = zf.getInputStream(ze);
      for (int c = in.read(); c != -1; c = in.read()) {
        fout.write(c);
      }
      in.close();
      fout.close();
    }