I use the groovy AntBuilder in a custom written installer, eg. to unpack the installation package. One thing I cannot figure out, is how to detect, whether the unzip task failed, eg. I have the following code:
... AntBuilder antBuilder = new AntBuilder() antBuilder.mkdir(dir:installationPath) antBuilder.unzip(src:zipFileName, dest:installationPath,overwrite:"yes") ...
If the destination path ("installationPath") is write protected, the unzip reports errors ("unable to expand..."), but the task itself does not fail. There is also no "failOnError" attribute for unzip.
Is there a way to force a unzip task to fail, if the target is writeprotected (or the drive is full, etc.)?