Giriş
Şu satırı dahil ederiz.
Şöyle yaparız
Şu satırı dahil ederiz.
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
constructor - InputStreamŞöyle yaparız
public static List<String> unzipFiles(File zipFile, File targetDirectory) {
List<String> files = new ArrayList<String>();
try (FileInputStream fileInputStream = new FileInputStream(zipFile);
ZipArchiveInputStream zipInputStream = new ZipArchiveInputStream(
new BufferedInputStream(fileInputStream));){
ZipEntry zipEntry;
while ((zipEntry = zipInputStream.getNextZipEntry()) != null) {
...
}
} catch (Exception e) {
e.printStackTrace();
}
return files;
}
Hiç yorum yok:
Yorum Gönder