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
Fri Dec 5 23:53:00 UTC 2014


On Sat, Dec 6, 2014 at 12:45 AM, Brian Burkhalter
<brian.burkhalter at oracle.com> wrote:
[...]
>
> Well, I don’t have the background in this area to know the history or design
> intent, but to me it seems preferable to have fail fast behavior such as
> that apparently implemented by newOutputStream.
>

Agreed on that; also, it'd be really nice to have an exception such as
IsDirectoryException or the like for such cases.

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