Package org.apache.naming.resources

Examples of org.apache.naming.resources.CacheEntry


                String trimmed = resourceName/*.substring(trim)*/;
                if (trimmed.equalsIgnoreCase("WEB-INF") ||
                    trimmed.equalsIgnoreCase("META-INF"))
                    continue;

                CacheEntry childCacheEntry =
                    resources.lookupCache(cacheEntry.name + resourceName);
                if (!childCacheEntry.exists) {
                    continue;
                }

View Full Code Here


        // (the "toUpperCase()" avoids problems on Windows systems)
        if (path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF") ||
            path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF"))
            return;

        CacheEntry cacheEntry = resources.lookupCache(path);
        if (!cacheEntry.exists) {
            // File is in directory listing but doesn't appear to exist
            // Broken symlink or odd permission settings?
            return;
        }
View Full Code Here

            else
                log("DefaultServlet.serveResource:  Serving resource '" +
                    path + "' headers only");
        }

        CacheEntry cacheEntry = resources.lookupCache(path);

        if (!cacheEntry.exists) {
            // Check if we're included so we can return the appropriate
            // missing resource name in the error
            String requestUri = (String) request.getAttribute(
View Full Code Here

                    continue;

                if ((cacheEntry.name + trimmed).equals(contextXsltFile))
                    continue;

                CacheEntry childCacheEntry =
                    resources.lookupCache(cacheEntry.name + resourceName);
                if (!childCacheEntry.exists) {
                    continue;
                }
View Full Code Here

                String trimmed = resourceName/*.substring(trim)*/;
                if (trimmed.equalsIgnoreCase("WEB-INF") ||
                    trimmed.equalsIgnoreCase("META-INF"))
                    continue;

                CacheEntry childCacheEntry =
                    resources.lookupCache(cacheEntry.name + resourceName);
                if (!childCacheEntry.exists) {
                    continue;
                }

View Full Code Here

        // Exclude any resource in the /WEB-INF and /META-INF subdirectories
        if (isSpecialPath(path))
            return;

        CacheEntry cacheEntry = resources.lookupCache(path);
        if (!cacheEntry.exists) {
            // File is in directory listing but doesn't appear to exist
            // Broken symlink or odd permission settings?
            return;
        }
View Full Code Here

            else
                log("DefaultServlet.serveResource:  Serving resource '" +
                    path + "' headers only");
        }

        CacheEntry cacheEntry = resources.lookupCache(path);

        if (!cacheEntry.exists) {
            // Check if we're included so we can return the appropriate
            // missing resource name in the error
            String requestUri = (String) request.getAttribute(
View Full Code Here

                if (trimmed.equalsIgnoreCase("WEB-INF") ||
                    trimmed.equalsIgnoreCase("META-INF") ||
                    trimmed.equalsIgnoreCase(localXsltFile))
                    continue;

                CacheEntry childCacheEntry =
                    resources.lookupCache(cacheEntry.name + resourceName);
                if (!childCacheEntry.exists) {
                    continue;
                }
View Full Code Here

                String trimmed = resourceName/*.substring(trim)*/;
                if (trimmed.equalsIgnoreCase("WEB-INF") ||
                    trimmed.equalsIgnoreCase("META-INF"))
                    continue;

                CacheEntry childCacheEntry =
                    resources.lookupCache(cacheEntry.name + resourceName);
                if (!childCacheEntry.exists) {
                    continue;
                }

View Full Code Here

            else
                log("DefaultServlet.serveResource:  Serving resource '" +
                    path + "' headers only");
        }

        CacheEntry cacheEntry = null;
        ProxyDirContext proxyDirContext = resources;
        if (alternateDocBases == null
                || alternateDocBases.size() == 0) {
            cacheEntry = proxyDirContext.lookupCache(path);
        } else {
            AlternateDocBase match = AlternateDocBase.findMatch(
                                            path, alternateDocBases);
            if (match != null) {
                cacheEntry = ((ProxyDirContext) match.getResources()).lookupCache(path);
            } else {
                // None of the url patterns for alternate docbases matched
                cacheEntry = proxyDirContext.lookupCache(path);
            }
        }

        if (!cacheEntry.exists) {
            // Try looking up resource in
            // WEB-INF/lib/[*.jar]/META-INF/resources
            ClassLoader cl = Thread.currentThread().getContextClassLoader();
            String metaInfResPath = Globals.META_INF_RESOURCES + path;
            if (cl instanceof WebappClassLoader) {
                WebappClassLoader wcl = (WebappClassLoader)cl;
                final URL resourceUrl = wcl.getResourceFromJars(metaInfResPath);
                if (resourceUrl != null) {
                    // XXX Remove dependency on WebappClassLoader
                    ConcurrentHashMap<String, ResourceEntry> resourceEntries =
                        wcl.getResourceEntries();
                    ResourceEntry resourceEntry = resourceEntries.get(metaInfResPath);
                    if (resourceEntry != null) {
                        // create a CacheEntry to continue the processing
                        cacheEntry = new CacheEntry();
                        try {
                            URI resourceUri = resourceUrl.toURI();
                            if ("file".equals(resourceUri.getScheme()) &&
                                    (new File(resourceUri)).isDirectory()) {
                                if (!path.endsWith("/")) {
View Full Code Here

TOP

Related Classes of org.apache.naming.resources.CacheEntry

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.