Path.moveTo() javadoc question

Alan Bateman Alan.Bateman at Sun.COM
Fri Oct 23 14:32:49 PDT 2009


Vince Bonfanti wrote:
> A minor quibble; the Path.moveTo() javadoc says it throws a
> FileAlreadyExistsException "if the target file exists and cannot be
> replaced because the REPLACE_EXISTING option is not specified, or the
> target file is a non-empty directory." In the case of a non-empty
> directory, shouldn't it throw a DirectoryNotEmptyException?
>   
That would be better and make sense for when you specify the 
REPLACE_EXISTING option. If you don't specify the REPLACE_EXISTING 
option then FileAlreadyExistsException is right. I need to verify that 
it doesn't impact the specification of ATOMIC_MOVE as that option 
prevents an implementation from doing any checks that would cause the 
operation to be non-atomic. Assuming there aren't any issues then I will 
create a bug to track this.

-Alan.


More information about the nio-discuss mailing list