// Update the configuration XML file using the generated XSLT. For now,
// place the generated file into the undeploy directory:
File configFile = new File(path);
File outputFile = new File(this.undeployDir, configFile.getName());
InputStream configStream = new FileInputStream(configFile);
InputStream xsltStream = new StringBufferInputStream(buf.toString());
OutputStream outputStream = new FileOutputStream(outputFile);
XslTransformer.applyTransformation(configStream, outputStream, xsltStream, null);
configStream.close();
xsltStream.close();
outputStream.close();
// Now that we have the generated file, move it to its proper location
if (!configFile.delete())
throw new Exception("Update failed for '" + name + "', unable to delete old configuration file: " + path);