From 32f996d9d6c44721453118f0e91e7ffd0a29cab0 Mon Sep 17 00:00:00 2001 From: sherman Date: Fri, 4 Mar 2011 11:35:53 -0800 Subject: [PATCH] 7023244: (zipfs) langtools CompileTest fails on read-only file system Summary: replaced checkAccess with Files.isWritable() Reviewed-by: alanb --- .../demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java index 40afd8afb..fc43fd87c 100644 --- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java @@ -112,11 +112,8 @@ public class ZipFileSystem extends FileSystem { } // 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); -- GitLab