Path.createFile() and Path.createDirectory() throw NoSuchFileException if parent doesn't exist (Windows)

Alan Bateman Alan.Bateman at Sun.COM
Tue Aug 25 12:43:01 PDT 2009


Vince Bonfanti wrote:
> Yes, that helps. Thanks.
>
> It may be a minor point, but I suggest that the Javadocs for Path
> explicitly state that an exception is thrown if the parent doesn't
> exist; maybe even list NoSuchFileException as an "optional specific
> exception" as is done for FileAlreadyExistsException. Because the
> Javadocs for Path are silent on this point, I wasn't sure about the
> behavior until I actually tested it.
>
> Vince
>   
Okay, we can make this clearer and explicitly state that it doesn't 
attempt to create parent directories (need to think more about listing 
NoSuchFileException as a specific exception).

-Alan.


More information about the nio-discuss mailing list