Package org.apache.catalina.util

Examples of org.apache.catalina.util.ContextName


     */
    protected void deployApps(String name) {

        File appBase = appBase();
        File configBase = configBase();
        ContextName cn = new ContextName(name);
        String baseName = cn.getBaseName();
       
        // Deploy XML descriptors from configBase
        File xml = new File(configBase, baseName + ".xml");
        if (xml.exists())
            deployDescriptor(cn, xml, baseName + ".xml");
View Full Code Here


       
        for (int i = 0; i < files.length; i++) {
            File contextXml = new File(configBase, files[i]);

            if (files[i].toLowerCase(Locale.ENGLISH).endsWith(".xml")) {
                ContextName cn = new ContextName(files[i]);
                String name = cn.getName();

                if (isServiced(name))
                    continue;
               
                String file = files[i];
View Full Code Here

                continue;
            File dir = new File(appBase, files[i]);
            if (files[i].toLowerCase(Locale.ENGLISH).endsWith(".war") && dir.isFile()
                    && !invalidWars.contains(files[i]) ) {
               
                ContextName cn = new ContextName(files[i]);
               
                // Check for WARs with /../ /./ or similar sequences in the name
                if (!validateContextPath(appBase, cn.getBaseName())) {
                    log.error(sm.getString(
                            "hostConfig.illegalWarName", files[i]));
                    invalidWars.add(files[i]);
                    continue;
                }

                if (isServiced(cn.getName()))
                    continue;
               
                String file = files[i];
               
                deployWAR(cn, dir, file);
View Full Code Here

                continue;
            if (files[i].equalsIgnoreCase("WEB-INF"))
                continue;
            File dir = new File(appBase, files[i]);
            if (dir.isDirectory()) {
                ContextName cn = new ContextName(files[i]);

                if (isServiced(cn.getName()))
                    continue;

                deployDirectory(cn, dir, files[i]);
            }
        }
View Full Code Here

    }


    @Override
    public String getBaseName() {
        return new ContextName(path, webappVersion).getBaseName();
    }
View Full Code Here

     */
    @Override
    public void fileModified(File newWar) {
        try {
            File deployWar = new File(getDeployDirFile(), newWar.getName());
            ContextName cn = new ContextName(deployWar.getName());
            if (deployWar.exists() && deployWar.lastModified() > newWar.lastModified()) {
                if (log.isInfoEnabled())
                    log.info(sm.getString("farmWarDeployer.alreadyDeployed", cn.getName()));
                return;
            }
            if (log.isInfoEnabled())
                log.info(sm.getString("farmWarDeployer.modInstall",
                        cn.getName(), deployWar.getAbsolutePath()));
            // install local
            if (!isServiced(cn.getName())) {
                addServiced(cn.getName());
                try {
                    copy(newWar, deployWar);
                    check(cn.getName());
                } finally {
                    removeServiced(cn.getName());
                }
            } else {
                log.error(sm.getString("farmWarDeployer.servicingDeploy",
                        cn.getName(), deployWar.getName()));
            }
            install(cn.getName(), deployWar);
        } catch (Exception x) {
            log.error(sm.getString("farmWarDeployer.modInstallFail"), x);
        }
    }
View Full Code Here

     * @see org.apache.catalina.ha.deploy.FileChangeListener#fileRemoved(File)
     */
    @Override
    public void fileRemoved(File removeWar) {
        try {
            ContextName cn = new ContextName(removeWar.getName());
            if (log.isInfoEnabled())
                log.info(sm.getString("farmWarDeployer.removeLocal",
                        cn.getName()));
            remove(cn.getName(), true);
        } catch (Exception x) {
            log.error(sm.getString("farmWarDeployer.removeLocalFail"), x);
        }
    }
View Full Code Here

            // Trying to guess the docBase according to the path
            String path = context.getPath();
            if (path == null) {
                return;
            }
            ContextName cn = new ContextName(path, context.getWebappVersion());
            docBase = cn.getBaseName();
        }

        File file = new File(docBase);
        if (!file.isAbsolute()) {
            docBase = (new File(canonicalAppBase, docBase)).getPath();
        } else {
            docBase = file.getCanonicalPath();
        }
        file = new File(docBase);
        String origDocBase = docBase;

        ContextName cn = new ContextName(context.getPath(),
                context.getWebappVersion());
        String pathName = cn.getBaseName();

        boolean unpackWARs = true;
        if (host instanceof StandardHost &&
                context instanceof StandardContext) {
            unpackWARs = ((StandardHost) host).isUnpackWARs() &&
View Full Code Here

            String path = context.getPath();
            if (path == null) {
                return;
            }
            ContextName cn = new ContextName(path, context.getWebappVersion());
            docBase = cn.getBaseName();

            if (originalDocBase.toLowerCase(Locale.ENGLISH).endsWith(".war")) {
                antiLockingDocBase = new File(
                        System.getProperty("java.io.tmpdir"),
                        deploymentCount++ + "-" + docBase + ".war");
View Full Code Here

            // Trying to guess the docBase according to the path
            String path = context.getPath();
            if (path == null) {
                return;
            }
            ContextName cn = new ContextName(path, context.getWebappVersion());
            docBase = cn.getBaseName();
        }

        File file = new File(docBase);
        if (!file.isAbsolute()) {
            docBase = (new File(canonicalAppBase, docBase)).getPath();
        } else {
            docBase = file.getCanonicalPath();
        }
        file = new File(docBase);
        String origDocBase = docBase;
       
        ContextName cn = new ContextName(context.getPath(),
                context.getWebappVersion());
        String pathName = cn.getBaseName();

        if (docBase.toLowerCase(Locale.ENGLISH).endsWith(".war") && !file.isDirectory() && unpackWARs) {
            URL war = new URL("jar:" + (new File(docBase)).toURI().toURL() + "!/");
            docBase = ExpandWar.expand(host, war, pathName);
            file = new File(docBase);
View Full Code Here

TOP

Related Classes of org.apache.catalina.util.ContextName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.