InputStream sourceWebXmlFile = null;
File webXml = new File(basedir, "WEB-INF/web.xml");
try {
sourceWebXmlFile = new FileInputStream(webXml);
xwebPatcher.applyPatches(sourceWebXmlFile, "WEB-INF/web.xml");
} catch (FileNotFoundException e) {
throw new DeploymentException("Can't apply patches on " + webXml + ".", e);
} finally {
IOUtils.closeQuietly(sourceWebXmlFile);
}