ile açabilmem mümkün değil. Bir dosyayı java kullanarak açmaya çalışıyorum ama aşağıdaki kod while döngüsünü 'ze' null olarak girmiyor. Ancak aynı dosya 7zip uygulamasını kullanarak unzip mümkün. Birisi bana neden böyle bir şey olduğunu bildirir mi?Bir dosyayı java kullanarak açamıyor ama 7zip
try {
//get the zip file content
ZipInputStream zis =
new ZipInputStream(new FileInputStream(zipFile));
//get the zipped file list entry
ZipEntry ze = zis.getNextEntry();
while(ze!=null){
String fileName = ze.getName();
File newFile = new File(outputFolder + File.separator + fileName);
System.out.println("file unzip : "+ newFile.getAbsoluteFile());
//create all non exists folders
//else you will hit FileNotFoundException for compressed folder
new File(newFile.getParent()).mkdirs();
FileOutputStream fos = new FileOutputStream(newFile);
int len;
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
fos.close();
ze = zis.getNextEntry();
}
zis.closeEntry();
zis.close();
System.out.println("Done");
}catch(IOException ex){
ex.printStackTrace();
}
Bir .7z dosyası mı, yoksa bir .zip dosyası mı? – AJNeufeld