public static void main(String[] args) { try { ZipFile zip = new ZipFile(new File("D:\\content\\randomDocuments\\randomDocuments.zip")); ZipEntry zipEntry; Enumeration files = zip.entries(); while (files.hasMoreElements()) { zipEntry = (ZipEntry)files.nextElement(); String name = zipEntry.getName(); System.out.println("The zipped file " + name + " the following Data" ); InputStream in = zip.getInputStream(zipEntry); if (name.endsWith(".zip")) { System.out.println("There is a zip in this zip! " + name); //now what?? } } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
Luke
SCJP
K Riaz
Ranch Hand
Joined: Jan 08, 2005
Posts: 375
posted
0
Why not extract the file to a temporary location and then read it as a fresh normal single ZIP file?
And please use the CODE tags. [ March 04, 2005: Message edited by: Kashif Riaz ]
Luke Shannon
Ranch Hand
Joined: Sep 30, 2004
Posts: 239
posted
0
This may be what I will have to do. I was hoping to avoid IO operations in this case.
Thanks,
Luke
Ernest Friedman-Hill
author and iconoclast
Marshal
I just want to tell that Ernest Friedman-Hill is right, use ZipInputStream instead of ZipFile, I have tested for 3 days to unzip my 120 GB Data without problem.