7023244: (zipfs) langtools CompileTest fails on read-only file system
Summary: replaced checkAccess with Files.isWritable()
Reviewed-by: alanb
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Fri Mar 04 09:32:20 2011 -0800
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Fri Mar 04 11:35:53 2011 -0800
@@ -112,11 +112,8 @@
}
// sm and existence check
zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.READ);
- try {
- zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.WRITE);
- } catch (AccessDeniedException x) {
+ if (!Files.isWritable(zfpath))
this.readOnly = true;
- }
this.zc = ZipCoder.get(nameEncoding);
this.defaultdir = new ZipPath(this, getBytes(defaultDir));
this.ch = Files.newByteChannel(zfpath, READ);