use of org.apache.knox.gateway.deploy.DeploymentException in project knox by apache.
the class GatewayServer method internalDeployApplication.
private synchronized void internalDeployApplication(Topology topology, File topoDir, Application application, String url) throws IOException, ZipException, TransformerException, SAXException, ParserConfigurationException {
File appsDir = new File(config.getGatewayApplicationsDir());
File appDir = new File(appsDir, application.getName());
File[] implFiles = appDir.listFiles(new RegexFilenameFilter("app|app\\..*"));
if (implFiles == null || implFiles.length == 0) {
throw new DeploymentException("Failed to find application in " + appDir);
}
File implFile = implFiles[0];
File warDir = new File(topoDir, Urls.encode("/" + Urls.trimLeadingAndTrailingSlash(url)));
File webInfDir = new File(warDir, "WEB-INF");
explodeWar(implFile, warDir);
mergeWebXmlOverrides(webInfDir);
createArchiveTempDir(warDir);
}
Aggregations