在應用程序中,我們使用 zip4j 庫來解壓縮 zip 文件。File toBeExtractedFile = new File("valid/path/to/File");ZipFile zipFile = new ZipFile(toBeExtractedFile);zipFile.setFileNameCharset(StandardCharsets.UTF_8.name);zipFile.extractAll("valid/path")使用 .zip 文件,此代碼可以正常工作。但是當使用 .tar 文件完成時,這將拋出一個new ZipException("zip headers not found. probably not a zip file"); Can the zip4j library extract TAR files when given additional info or parameters or I have to use other things like a TarArchiveInputstream?
添加回答
舉報
0/150
提交
取消