NIO2's Path.moveTo(...) needs renameTo(...) aequivalent,or at least javadoc clarification.

Alan Bateman Alan.Bateman at Sun.COM
Mon Dec 21 06:14:59 PST 2009


John Hendrikx wrote:
> That might have been me.  I'm still in favor of having a distinct 
> rename method, even if it just redirects to moveTo internally, if only 
> to avoid confusion.  For my specific needs it is always clear when I 
> want a rename or a move as the move case must be implemented by a 
> copy+verify+delete (so I cannot let the default implementation do the 
> move).  If a move accidently occurs when I really wanted a rename it 
> would be a bug that needed fixing.  NOCOPY_ALLOWED helps to find those 
> bugs instead of it silently doing a potentially very slow move operation.
It might be right thing to do. There are a number of small API fixes, 
most discussed here, that I need to resolve in the new year and I'll add 
this to the list to examine.

-Alan.

PS: an alternative name for the NOCOPY_ALLOWED option is RENAME_ONLY. If 
combined with a few improvements to the javadoc then it would mightn't 
be too bad either.


More information about the nio-dev mailing list