Open Zip File Using ZipFile Class - Java File Path IO

Java examples for File Path IO:Zip File

Description

Open Zip File Using ZipFile Class

Demo Code


import java.io.IOException;
import java.util.zip.ZipFile;
 
public class Main {
       /*from w w w.  j a v  a2 s  .  c om*/
        public static void main(String args[])
        {
                 try
                 {
                        ZipFile zipFile = new ZipFile("c:/Folder/WebFiles.zip");
                        System.out.println(zipFile.getName() + " Opened for reading!");
                        zipFile.close();
                 }
                 catch(IOException ioe)
                 {
                        System.out.println("Error opening zip file" + ioe);
                 }
        }
}

Result


Related Tutorials