public final class Jsr203ZipBug
{
public static void main(final String... args)
throws IOException
{
final Path zipPath
= Paths.get(System.getProperty("java.io.tmpdir"), "t.zip");
Files.deleteIfExists(zipPath);
final URI uri = URI.create("jar:" + zipPath.toUri());
final Map<String, ?> env = Collections.singletonMap("create", "true");
try (
final FileSystem zipfs = FileSystems.newFileSystem(uri, env);
final OutputStream out
= Files.newOutputStream(zipfs.getPath("/foo"));
) {
out.write("hello".getBytes());
out.close();
}
}
}