8066915: (fs) Files.newByteChannel opens directories for cases where subsequent reads may fail

Francis Galiegue fgaliegue at gmail.com
Wed Dec 10 12:44:29 UTC 2014


On Wed, Dec 10, 2014 at 1:29 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> As per a recent thread, it's currently possible to open a directory for read
> access but attempts to actually read will fail. As discussed we are missing
> a fstat to check the file type so that we can fail when creating the
> channel. The webrev with the changes to fix this are here:
>   http://cr.openjdk.java.net/~alanb/8066915/webrev/
>
> Thanks,
> Alan.

Can this possibly be fixed for Windows as well, instead of getting an
AccessDeniedException?

-- 
Francis Galiegue, fgaliegue at gmail.com, https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)


More information about the nio-dev mailing list