copyTo/moveTo overwrite

Salter, Thomas A Thomas.Salter at unisys.com
Thu Jan 14 08:46:41 PST 2010


When doing a copyTo or moveTo with different providers, it looks like AbstractPath.copyToForeignTarget will overwrite the target file even if REPLACE_EXISTING is not set.  It correctly deletes the target only if REPLACE_EXISTING is set but then later in copyRegularFileToForeignTarget calls newByteChannel with CREATE, so any existing file is overwritten.  It should have used CREATE_NEW instead of CREATE.







-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20100114/52cb771e/attachment.html 


More information about the nio-dev mailing list