Şu satırı dahil ederiz.
import org.apache.commons.compress.archivers.zip.ZipFile;
constructor - FileŞöyle yaparız
ZipFile z = new ZipFile(zippath);
Enumeration<ZipArchiveEntry> entries = z.getEntries();
while(entries.hasMoreElements()) {
ZipArchiveEntry entry = entries.nextElement();
System.out.println("Entry: "+entry.getName());
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(unzipfolder+"\\"+entry.getName()));
BufferedInputStream bis = new BufferedInputStream(z.getInputStream(entry));
byte[] buffer=new byte[1000000];
int len=0;
while((len=bis.read(buffer,0,1000000))>0) {
bos.write(buffer, 0, len) ;
}
bis.close();
bos.close();
}
Hiç yorum yok:
Yorum Gönder