changeset 3841:90b7926884a8

7023244: (zipfs) langtools CompileTest fails on read-only file system Summary: replaced checkAccess with Files.isWritable() Reviewed-by: alanb
author sherman
date Fri, 04 Mar 2011 11:35:53 -0800
parents c4bd93431a20
children 28bedf6eba87
files src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java	Fri Mar 04 09:32:20 2011 -0800
+++ b/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);