@Override public void writeTo(XmlWriter writer) { writer.start(ID); if (file != null) { writer.attr("file", file.getAbsolutePath()); } if (tofile != null) { writer.attr("tofile", tofile.getAbsolutePath()); } writer.attr("overwrite", String.valueOf(overwrite)); if (md5 != null) { writer.attr("md5", md5); } if (removeOnExit) { writer.attr("removeOnExit", "true"); } if (overwriteIfNewerVersion) { writer.attr("overwriteIfNewerVersion", "true"); } if (upgradeOnly) { writer.attr("upgradeOnly", "true"); } if (append) { writer.attr("append", "true"); } writer.end(); }
@Override public void writeTo(XmlWriter writer) { writer.start(ID); if (addtemplate != null) { writer.attr("addtemplate", addtemplate); } if (rmtemplate != null) { writer.attr("rmtemplate", rmtemplate); } if (set != null) { writer.attr("set", set); } writer.end(); }
public void writeLog(File file) throws PackageException { XmlWriter writer = new XmlWriter(); writer.start("uninstall"); writer.startContent(); for (Command cmd : commandLog) { cmd.writeTo(writer); } writer.end("uninstall"); try { // replace all occurrences of the installation path with the corresponding variable otherwise // the uninstall // will not work after renaming the installation directory String content = parametrizePaths(writer.toString()); // replace '//' by '/' if any content = content.replace(File.separator.concat(File.separator), File.separator); FileUtils.writeFile(file, content); } catch (IOException e) { throw new PackageException("Failed to write commands", e); } }