When FileChannel calls the transferFrom() method, if it fails in the middle somewhere, does it rollback it's changes?
Joined: Jan 30, 2000
Unlikely. If you're concerned about this, I'd recommend copying the bytes to a tempfile first. If the transferFrom completes successfully, then close the FileChannel and rename the file to whatever name you originally wanted it to have. If a problem occurs during the transfer, simply delete the tempfile afterwards.
"I'm not back." - Bill Harding, Twister
Joined: Jun 25, 2004
I would do that, but I need to append.
There is a method in FileChannel called force(), it is suppose to make recovery possible. But it throws an exception, "Access is denied".