Bug or not bug? Files.newInputStream() on a Path which is a directory does not fail until you read from it

Francis Galiegue fgaliegue at gmail.com
Sat Dec 6 00:07:54 UTC 2014


On Sat, Dec 6, 2014 at 1:01 AM, Brian Burkhalter
<brian.burkhalter at oracle.com> wrote:
[...]
>
>
> Actually this suggestion is not good as “file” subsumes regular files,
> directories, and links.
>

And, on Unix systems, named pipes, character/block devices etc; all of
which can be read from/written to. I do believe IsDirectoryException
is on the right track here.

-- 
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