Open Zip File From File Object - Java File Path IO

Java examples for File Path IO:Zip File

Description

Open Zip File From File Object

Demo Code

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

Result


Related Tutorials