NIO's transferTo, right?
I didn't remember this at the point of writing, but yes, transferTo.
Google says that with certain restrictions on the size of the chunk transferred at once (eg. one huge chunk for linux, 64mb-something chunks for windows), this works crossplatform.
NIO2@Java7 has an even more simple Path.copyTo() method, so happy 7 users can use this.
For backups I wonder if we should make a copyTo/From that takes an IndexCommit
Ohmigosh, no! : }
You can get file list from IC and feed it into copy(). More power with less API surface.
I'm going to add two methods copyTo(target) and copyTo(target, filenames), rewrite copy(source, target, close) to use these and deprecate it.
There's no point in keeping around slightly different versions of the same thing, and I believe people can easily close their source dirs by themselves, what a stupid option.