2830N/AZipFileSystem is a file system provider that treats the contents of a zip or
2830N/AJAR file as a java.nio.file.FileSystem.
2830N/A
2830N/AThe factory methods defined by the java.nio.file.FileSystems class can be
2830N/Aused to create a FileSystem, eg:
2830N/A
2830N/A // use file type detection
3060N/A Path jarfile = Paths.get("foo.jar");
3478N/A FileSystem fs = FileSystems.newFileSystem(jarfile, null);
2830N/A
2830N/A-or
2830N/A
3216N/A // locate file system by the legacy JAR URL syntax
2830N/A Map<String,?> env = Collections.emptyMap();
3216N/A URI uri = URI.create("jar:file:/mydir/foo.jar");
2830N/A FileSystem fs = FileSystems.newFileSystem(uri, env);
2830N/A
2830N/AOnce a FileSystem is created then classes in the java.nio.file package
2830N/Acan be used to access files in the zip/JAR file, eg:
2830N/A
2830N/A Path mf = fs.getPath("/META-INF/MANIFEST.MF");
2830N/A InputStream in = mf.newInputStream();
2830N/A
3216N/ASee Demo.java for more interesting usages.
2830N/A
3216N/A