You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the tool(2.9.0) to delete the file in the zip (android device), I can get the fileHeader by looking at the file name as garbled on the PC side, but an error is reported when I use fileHeader or filename to delete it....However, it works normally in version 1.3.2
file name: 反折L型缺口板.SLDPRT.view
code:
ZipFile zipFile = new ZipFile(destFile);
String removeName = null;
try {
List fileHeaders = zipFile.getFileHeaders();
for (FileHeader fileHeader : fileHeaders) {
String name = fileHeader.getFileName();
if (name.endsWith(".view")) {
removeName = name;
break;
}
}
if (removeName == null)
return;
zipFile.removeFile(removeName);
} catch (ZipException e) {
e.printStackTrace();
}
Exception:
System.err: net.lingala.zip4j.exception.ZipException: invalid offsets
System.err: at net.lingala.zip4j.util.FileUtils.copyFile(FileUtils.java:305)
System.err: at net.lingala.zip4j.tasks.AbstractModifyFileTask.copyFile(AbstractModifyFileTask.java:72)
System.err: at net.lingala.zip4j.tasks.RemoveFilesFromZipTask.executeTask(RemoveFilesFromZipTask.java:67)
System.err: at net.lingala.zip4j.tasks.RemoveFilesFromZipTask.executeTask(RemoveFilesFromZipTask.java:22)
System.err: at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:51)
System.err: at net.lingala.zip4j.tasks.AsyncZipTask.execute(AsyncZipTask.java:45)
System.err: at net.lingala.zip4j.ZipFile.removeFiles(ZipFile.java:839)
System.err: at net.lingala.zip4j.ZipFile.removeFile(ZipFile.java:807)
System.err: at me.pqpo.zip4jdemo.MainActivity.testremove(MainActivity.java:48)
The text was updated successfully, but these errors were encountered:
Hi. Are you able to reproduce this issue with a zip file that you can share with me? Without the zip file it will be quite hard to see what is going wrong.
Hi. Are you able to reproduce this issue with a zip file that you can share with me? Without the zip file it will be quite hard to see what is going wrong.
When I use the tool(2.9.0) to delete the file in the zip (android device), I can get the fileHeader by looking at the file name as garbled on the PC side, but an error is reported when I use fileHeader or filename to delete it....However, it works normally in version 1.3.2
file name: 反折L型缺口板.SLDPRT.view
code:
ZipFile zipFile = new ZipFile(destFile);
String removeName = null;
try {
List fileHeaders = zipFile.getFileHeaders();
for (FileHeader fileHeader : fileHeaders) {
String name = fileHeader.getFileName();
if (name.endsWith(".view")) {
removeName = name;
break;
}
}
if (removeName == null)
return;
zipFile.removeFile(removeName);
} catch (ZipException e) {
e.printStackTrace();
}
Exception:
System.err: net.lingala.zip4j.exception.ZipException: invalid offsets
System.err: at net.lingala.zip4j.util.FileUtils.copyFile(FileUtils.java:305)
System.err: at net.lingala.zip4j.tasks.AbstractModifyFileTask.copyFile(AbstractModifyFileTask.java:72)
System.err: at net.lingala.zip4j.tasks.RemoveFilesFromZipTask.executeTask(RemoveFilesFromZipTask.java:67)
System.err: at net.lingala.zip4j.tasks.RemoveFilesFromZipTask.executeTask(RemoveFilesFromZipTask.java:22)
System.err: at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:51)
System.err: at net.lingala.zip4j.tasks.AsyncZipTask.execute(AsyncZipTask.java:45)
System.err: at net.lingala.zip4j.ZipFile.removeFiles(ZipFile.java:839)
System.err: at net.lingala.zip4j.ZipFile.removeFile(ZipFile.java:807)
System.err: at me.pqpo.zip4jdemo.MainActivity.testremove(MainActivity.java:48)
The text was updated successfully, but these errors were encountered: