7023244: (zipfs) langtools CompileTest fails on read-only file system
Replaced checkAccess with Files.isWritable() Reviewed-by: alanb
This commit is contained in:
parent
a5c5bb811d
commit
2b73fac982
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user