【发布时间】:2021-08-16 11:50:08
【问题描述】:
在分析结果文件时,值被正确写入,所以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());
【问题讨论】:
标签: java apache-commons-compress