Package org.apache.catalina

Examples of org.apache.catalina.WebResourceRoot


        String normPath = RequestUtil.normalize(path);
        if (normPath == null)
            return (null);

        WebResourceRoot resources = context.getResources();
        if (resources != null) {
            return resources.getResource(normPath).getURL();
        }

        return null;
    }
View Full Code Here


        String normalizedPath = RequestUtil.normalize(path);
        if (normalizedPath == null)
            return (null);

        WebResourceRoot resources = context.getResources();
        if (resources != null) {
            return resources.getResource(normalizedPath).getInputStream();
        }

        return null;
    }
View Full Code Here

        String normalizedPath = RequestUtil.normalize(path);
        if (normalizedPath == null)
            return (null);

        WebResourceRoot resources = context.getResources();
        if (resources != null) {
            return resources.listWebAppPaths(normalizedPath);
        }

        return null;
    }
View Full Code Here

    @Override
    public WebResource getResource(String path) {
        checkPath(path);
        String webAppMount = getWebAppMount();
        WebResourceRoot root = getRoot();
        if (path.startsWith(webAppMount)) {
            File f = file(path.substring(webAppMount.length()), false);
            if (f == null) {
                return new EmptyResource(root, path);
            }
View Full Code Here

    @Override
    public final WebResource getResource(String path) {
        checkPath(path);
        String webAppMount = getWebAppMount();
        WebResourceRoot root = getRoot();

        /*
         * Implementation notes
         *
         * The path parameter passed into this method always starts with '/'.
View Full Code Here

    @Override
    public WebResource getResource(String path) {
        checkPath(path);

        String webAppMount = getWebAppMount();
        WebResourceRoot root = getRoot();
        if (path.equals(webAppMount)) {
            File f = file("", true);
            if (f == null) {
                return new EmptyResource(root, path);
            }
View Full Code Here

    @Override
    public final WebResource getResource(String path) {
        checkPath(path);
        String webAppMount = getWebAppMount();
        WebResourceRoot root = getRoot();

        /*
         * Implementation notes
         *
         * The path parameter passed into this method always starts with '/'.
View Full Code Here

        if( log.isDebugEnabled() && workDir != null)
            log.debug(sm.getString("webappLoader.deploy", workDir.getAbsolutePath()));

        classLoader.setWorkDir(workDir);

        WebResourceRoot resources = context.getResources();

        // Setting up the class repository (/WEB-INF/classes), if it exists

        String classesPath = "/WEB-INF/classes";
        WebResource classes = resources.getResource(classesPath);

        if (classes.isDirectory()) {

            if(log.isDebugEnabled())
                log.debug(sm.getString("webappLoader.classDeploy", classesPath,
                        classes.getURL().toExternalForm()));

            // Adding the repository to the class loader
            classLoader.setRepository(classesPath + "/", classes);
            loaderRepositories.add(classesPath + "/" );
        }

        // Setting up the JAR repository (/WEB-INF/lib), if it exists
        // TODO Simplify this in a similar manner to WEB-INF/classes

        String libPath = "/WEB-INF/lib";

        classLoader.setJarPath(libPath);

        WebResource libDir = resources.getResource(libPath);

        if (libDir.isDirectory()) {

            boolean copyJars = false;
            String absoluteLibPath = libDir.getCanonicalPath();

            File destDir = null;

            if (absoluteLibPath != null) {
                destDir = new File(absoluteLibPath);
            } else {
                copyJars = true;
                destDir = new File(workDir, libPath);
                if (!destDir.mkdirs() && !destDir.isDirectory()) {
                    throw new IOException(
                            sm.getString("webappLoader.mkdirFailure"));
                }
            }

            WebResource[] jars = resources.listResources(libPath);
            for (WebResource jar : jars) {

                String jarName = jar.getName();

                if (!jarName.endsWith(".jar"))
View Full Code Here

    @Override
    public WebResource getResource(String path) {
        checkPath(path);
        String webAppMount = getWebAppMount();
        WebResourceRoot root = getRoot();
        if (path.startsWith(webAppMount)) {
            File f = file(path.substring(webAppMount.length()), true);
            if (f == null) {
                return new EmptyResource(root, path);
            }
View Full Code Here

    @Override
    public WebResource getResource(String path) {
        checkPath(path);

        String webAppMount = getWebAppMount();
        WebResourceRoot root = getRoot();
        if (path.equals(webAppMount)) {
            File f = file("", true);
            if (f == null) {
                return new EmptyResource(root, path);
            }
View Full Code Here

TOP

Related Classes of org.apache.catalina.WebResourceRoot

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.