groovy - ant unzip task: Why does it not fail, if unzipping fails? -
i use groovy antbuilder in custom written installer, eg. unpack installation package. 1 thing cannot figure out, how detect, whether unzip task failed, eg. have following code:
... antbuilder antbuilder = new antbuilder() antbuilder.mkdir(dir:installationpath) antbuilder.unzip(src:zipfilename, dest:installationpath,overwrite:"yes") ... if destination path ("installationpath") write protected, unzip reports errors ("unable expand..."), task not fail. there no "failonerror" attribute unzip.
is there way force unzip task fail, if target writeprotected (or drive full, etc.)?
it seems there no way catch exception.
according source code ant
protected void extractfile(fileutils fileutils, file srcf, file dir, inputstream compressedinputstream, string entryname, date entrydate, boolean isdirectory, filenamemapper mapper) throws ioexception { ........................... ........................... ........................... } catch (filenotfoundexception ex) { log("unable expand file " + f.getpath(), ex, project.msg_warn); } } it silently catches exception without re-throwing further.
Comments
Post a Comment