Hello.
Have some problem with ZipInputStream.
I have two simple tasks:
1. Download zip file from web.
2. Unzip file.
Zipped archive contains four text files.
So, all of the above is simply resolved with a help of ZipFile class, but when i use ZipInputStream, i got only one of four files unzipped in output, where i am did a mistake?
Here is the code:
URL url01=new URL(....);
ZipInputStream zis01=new ZipInputStream(url01.openStream());
ZipEntry zipEntry;
while((zipEntry=zis01.getNextEntry())!=null){
if(!zipEntry.isDirectory()){
PrintStream ps01=new PrintStream(new FileOutputStream(zipEntry.getName()),true);
BufferedReader bffr01=new BufferedReader(new InputStreamReader(zis01));
String line;
while((line=bffr01.readLine())!=null){
ps01.println(line);
}
ps01.close();
}
zis01.closeEntry();
}
zis01.close();
Edited by: 814785 on Sep 4, 2011 6:03 PM