在分析结果文件时,该值被正确写入,所以setUnixMode()
可能工作正常,但getUnixMode()
总是返回 0。有没有人有这方面的经验?
File file = new File("Test.file");
ZipArchiveOutputStream zipArchiveOutputStream = new ZipArchiveOutputStream(new FileOutputStream(file));
ZipArchiveEntry zipArchiveEntry = new ZipArchiveEntry("Entry");
zipArchiveEntry.setUnixMode(0744);
zipArchiveOutputStream.putArchiveEntry(zipArchiveEntry);
zipArchiveOutputStream.write("TestBytes".getBytes());
zipArchiveOutputStream.closeArchiveEntry();
zipArchiveOutputStream.close();
ZipArchiveInputStream zipArchiveInputStream = new ZipArchiveInputStream(new FileInputStream(file));
ZipArchiveEntry entryOut = zipArchiveInputStream.getNextZipEntry();
System.out.println(entryOut.getUnixMode());