Exemplo n.º 1
0
 @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();
 }
Exemplo n.º 2
0
 @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();
 }
Exemplo n.º 3
0
 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);
   }
 }