Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.3.1
-
None
Description
Ivy "resolve" tasks frequently result in truncated JAR files, causing the build to fail. I have observed this for the files being copied from the Web to the filesystem location, as well as for those being copied locally, for example from /opt/devel/ivy/ to $HOME/MyProject/lib/release/.
I was looking at Ivy, the source code for 1.3.1, and found a couple of things I questioned:
1. FileUtil.copy(File src, File dest, ...) did not ever check that, once the file was copied, src.length() == dest.length(). As an experiment, I added code to check this and throw an IOException if the sizes did not match.
2. Both CopyProgressEvent and TransferEvent classes have as fields the byte[] object used as the buffer during the copy. I can see no reason for that, and as an experiment, removed them, refactoring any affected classes as necessary.
I have a patch containing changes 1 and 2 and would like to contribute it.