United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7168172 (fs) Files.isReadable slow on Windows
JDK-7168172 : (fs) Files.isReadable slow on Windows

Details
Type:
Bug
Submit Date:
2012-05-11
Status:
Closed
Updated Date:
2012-12-13
Project Name:
JDK
Resolved Date:
2012-09-10
Component:
core-libs
OS:
generic
Sub-Component:
java.nio
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
8
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Checking file access on Windows is expensive because it requires reading the DACL and computing the effective access to the file. To bypass this, the checkAccess implementation on Windows has a fast path for the check read case but unfortunately Files.isReadable isn't using that fast path. This has been reported here:

http://mail.openjdk.java.net/pipermail/nio-dev/2012-May/001667.html

The workaround for the short is to replace Files.isReadbale(path) with path.getFileSystem().provider().checkAccess(path).

                                    

Comments
EVALUATION

Changeset: bd91a601265c
Author:    khazra
Date:      2012-08-24 11:48 -0700
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bd91a601265c

7168172: (fs) Files.isReadable slow on Windows
Summary: Remove DACL checking for read access, also reviewed by ###@###.###, ###@###.###
Reviewed-by: alanb

! src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java
                                     
2012-08-24



Hardware and Software, Engineered to Work Together