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

Joel Uckelman uckelman at nomic.net
Mon Dec 21 06:24:44 PST 2009


Thus spake Alan Bateman:
> 
> 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.
>

I'm not clear on the distinction between moving and renaming here. I
understand that in certian cases (e.g., when a file is moved from one
filesystem to another) moving a file results in copying all of its data,
while in other cases it does not (e.g., same-filesystem moves). Is this
the distinction which is being made between moving (which might involve
copying) and renaming (which does not involve copying)?

If there could conceivably be cases where renaming could still involve
a copy, then I think it's best to name the flag NOCOPY_ALLOWED to reflect
what it does, rather than RENAME_ONLY, which only reflects its (presently)
intended use.

-- 
J.


More information about the nio-dev mailing list