Search in sources :

Example 1 with DeploymentException

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);
}
Also used : DeploymentException(org.apache.knox.gateway.deploy.DeploymentException) ZipFile(net.lingala.zip4j.core.ZipFile) File(java.io.File)

Aggregations

File (java.io.File)1 ZipFile (net.lingala.zip4j.core.ZipFile)1 DeploymentException (org.apache.knox.gateway.deploy.DeploymentException)1