Java 7 の zip ファイルは、ファイル システムと同様に扱うことができます:
http://fahdshariff.blogspot.cz/2011/08/java-7-working-with-zip-files.html
私のプロジェクトでは、リソースに保存されている zip ファイルを処理したいと考えています。しかし、最初にそのファイルをディスクに保存せずに、リソース ストリーム (getResourceAsStream) を新しい FileSystems オブジェクトに直接変換する効率的な方法を見つけることができません。
Map<String, String> nameMap = new HashMap<>();
Path path = Files.createTempFile(null, ".zip");
Files.copy(MyClass.class.getResourceAsStream("/data.zip"), path, StandardCopyOption.REPLACE_EXISTING);
try (FileSystem zipFileSystem = FileSystems.newFileSystem(path, null)) {
Files.walkFileTree(zipFileSystem.getPath("/"), new NameMapParser(nameMap));
}
Files.delete(path);
何か不足していますか?