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
File baseDir = new File("/home/test");
File zipFile = new File("/home/test.zip");
try (FileOutputStream fos = new FileOutputStream(zipFile)) {
ZipUtil.pack(baseDir, fos, new NameMapper() {
@Override
public String map(String name) {
Map<String, String> map = new HashMap<>();
map.put("folder/file", "证明及协议/file.jpg");
map.put("folder/", "证明及协议/");
return map.get(name);
}
});
} catch (IOException e) {
}
Rename the folder to "证明及协议/" or some specific string, and the zipFile will contain the file with the same name as the folder, causing the decompression file to fail. test.zip
The text was updated successfully, but these errors were encountered:
Rename the folder to "证明及协议/" or some specific string, and the zipFile will contain the file with the same name as the folder, causing the decompression file to fail.
test.zip
The text was updated successfully, but these errors were encountered: