README.txt revision 2830
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/ATo deploy the provider you must copy zipfs.jar into your extensions
2830N/Adirectory or else add <JDK_HOME>/demo/nio/ZipFileSystem/zipfs.jar
2830N/Ato your class path.
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
2830N/A Map<String,?> env = Collections.emptyMap();
2830N/A Path jarfile = Path.get("foo.jar");
2830N/A FileSystem fs = FileSystems.newFileSystem(jarfile, env);
2830N/A
2830N/A-or
2830N/A
2830N/A // locate file system by URI
2830N/A Map<String,?> env = Collections.emptyMap();
2830N/A URI uri = URI.create("zip:///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
2830N/A