8289984: Files:isDirectory and isRegularFile methods not throwing SecurityException

Reviewed-by: iris, alanb
This commit is contained in:
Lance Andersen 2022-07-08 18:56:04 +00:00
parent 1877533f75
commit 6aaf141f61
2 changed files with 11 additions and 2 deletions

View file

@ -156,6 +156,7 @@ public abstract class UnixFileSystemProvider
{
if (type == BasicFileAttributes.class && Util.followLinks(options)) {
UnixPath file = UnixPath.toUnixPath(path);
file.checkRead();
try {
@SuppressWarnings("unchecked")
A attrs = (A) UnixFileAttributes.getIfExists(file);