JDK-7168172 : (fs) Files.isReadable slow on Windows
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-05-11
  • Updated: 2013-06-26
  • Resolved: 2012-09-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40Fixed 8 b55Fixed
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
24-08-2012