Description
I've been struggling to troubleshoot intermittent IOExceptions thrown from FileUtils.doCopyFile when copying 2-4KB files from a local temporary file to a network drive. Despite the error, the file appears on the network drive when I check. Should the output channel/buffer be forced/flushed before closing, and synchronized before comparing the file lengths? It's a rather intermittent issue on a relatively high throughput PC so I'd expect there to be more IO latency than normal.
I found myself referencing:
- The source code for FileUtils v2.5
- FileChannel#force(boolean)
- IO-443 - FileUtils.copyFile methods throw an unnecessary "Failed to copy full contents from" exception
Thanks,
Sean