Examples of ResourceCache


Examples of org.mortbay.http.ResourceCache

    public Resource getResource(String pathInContext) throws IOException {
      if (log.isDebugEnabled())
        log.debug("Getting resource " + pathInContext + ", checking in plugins");
        // First try all the plugins with the path for an overidden resource
        for (Iterator i = resourceCaches.iterator(); i.hasNext();) {
            ResourceCache cache = (ResourceCache) i.next();
            Resource r = cache.getResource(pathInContext);
            if (r != null && r.exists() && !r.isDirectory()) {
              if (log.isDebugEnabled())
                log.debug("Found in " + cache.getBaseResource().toString());
                return r;
            }
        }
        if (log.isDebugEnabled())
          log.debug("Checking for alias");
View Full Code Here

Examples of org.mortbay.http.ResourceCache

     * @see com.adito.boot.Context#addResourceBase(java.net.URL)
     */
    public void addResourceBase(URL base) {
        if (log.isInfoEnabled())
            log.info("Adding new resource base " + base.toExternalForm());
        ResourceCache cache = new ResourceCache();
        cache.setMimeMap(webappContext.getMimeMap());
        cache.setEncodingMap(webappContext.getEncodingMap());
        cache.setResourceBase(base.toExternalForm());
        try {
            cache.start();
            webappContext.addResourceCache(cache);
            if (httpContext != null) {
                httpContext.addResourceCache(cache);
            }
            resourceCaches.put(base, cache);
View Full Code Here

Examples of org.mortbay.http.ResourceCache

     * @see com.adito.boot.Context#addResourceBase(java.net.URL)
     */
    public void removeResourceBase(URL base) {
        if (log.isInfoEnabled())
            log.info("Removing resource base " + base.toExternalForm());
        ResourceCache cache = (ResourceCache) resourceCaches.get(base);
        webappContext.removeResourceCache(cache);
        if (httpContext != null) {
            httpContext.removeResourceCache(cache);
        }
    }
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

            }
            if ("bio".equals(cache_type)|| "both".equals(cache_type))
            {
                if (max_cache_size==-2 || max_cache_size>0)
                {
                    _bioCache=new ResourceCache(_mimeTypes);
                    if (max_cache_size>0)
                        _bioCache.setMaxCacheSize(max_cache_size);   
                    if (max_cached_file_size>=-1)
                        _bioCache.setMaxCachedFileSize(max_cached_file_size);   
                    if (max_cached_files>=-1)
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

        // Find the resource and content
        Resource resource=null;
        HttpContent content=null;
       
        Connector connector = HttpConnection.getCurrentConnection().getConnector();
        ResourceCache cache=(connector instanceof NIOConnector) ?_nioCache:_bioCache;
        try
        {  
            // Try gzipped content first
            if (gzip)
            {
                pathInContextGz=pathInContext+".gz"
                resource=getResource(pathInContextGz);

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
                else if (cache!=null)
                {
                    content=cache.lookup(pathInContextGz,resource);
                    if (content!=null)
                        resource=content.getResource();
                }

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
            }
       
            // find resource
            if (!gzip)
            {
                if (cache==null)
                    resource=getResource(pathInContext);
                else
                {
                    content=cache.lookup(pathInContext,this);

                    if (content!=null)
                        resource=content.getResource();
                    else
                        resource=getResource(pathInContext);
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

            }
            if ("bio".equals(cache_type)|| "both".equals(cache_type))
            {
                if (max_cache_size==-2 || max_cache_size>0)
                {
                    _bioCache=new ResourceCache(_mimeTypes);
                    if (max_cache_size>0)
                        _bioCache.setMaxCacheSize(max_cache_size);   
                    if (max_cached_file_size>=-1)
                        _bioCache.setMaxCachedFileSize(max_cached_file_size);   
                    if (max_cached_files>=-1)
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

        // Find the resource and content
        Resource resource=null;
        HttpContent content=null;
       
        Connector connector = HttpConnection.getCurrentConnection().getConnector();
        ResourceCache cache=(connector instanceof NIOConnector) ?_nioCache:_bioCache;
        try
        {  
            // Try gzipped content first
            if (gzip)
            {
                pathInContextGz=pathInContext+".gz"
                resource=getResource(pathInContextGz);

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
                else if (cache!=null)
                {
                    content=cache.lookup(pathInContextGz,resource);
                    if (content!=null)
                        resource=content.getResource();
                }

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
            }
       
            // find resource
            if (!gzip)
            {
                if (cache==null)
                    resource=getResource(pathInContext);
                else
                {
                    content=cache.lookup(pathInContext,this);

                    if (content!=null)
                        resource=content.getResource();
                    else
                        resource=getResource(pathInContext);
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

            }
            if ("bio".equals(cache_type)|| "both".equals(cache_type))
            {
                if (max_cache_size==-2 || max_cache_size>0)
                {
                    _bioCache=new ResourceCache(_mimeTypes);
                    if (max_cache_size>0)
                        _bioCache.setMaxCacheSize(max_cache_size);   
                    if (max_cached_file_size>=-1)
                        _bioCache.setMaxCachedFileSize(max_cached_file_size);   
                    if (max_cached_files>=-1)
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

        // Find the resource and content
        Resource resource=null;
        HttpContent content=null;
       
        Connector connector = HttpConnection.getCurrentConnection().getConnector();
        ResourceCache cache=(connector instanceof NIOConnector) ?_nioCache:_bioCache;
        try
        {  
            // Try gzipped content first
            if (gzip)
            {
                pathInContextGz=pathInContext+".gz"
                resource=getResource(pathInContextGz);

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
                else if (cache!=null)
                {
                    content=cache.lookup(pathInContextGz,resource);
                    if (content!=null)
                        resource=content.getResource();
                }

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
            }
       
            // find resource
            if (!gzip)
            {
                if (cache==null)
                    resource=getResource(pathInContext);
                else
                {
                    content=cache.lookup(pathInContext,this);

                    if (content!=null)
                        resource=content.getResource();
                    else
                        resource=getResource(pathInContext);
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

            }
            if ("bio".equals(cache_type)|| "both".equals(cache_type))
            {
                if (max_cache_size==-2 || max_cache_size>0)
                {
                    _bioCache=new ResourceCache(_mimeTypes);
                    if (max_cache_size>0)
                        _bioCache.setMaxCacheSize(max_cache_size);   
                    if (max_cached_file_size>=-1)
                        _bioCache.setMaxCachedFileSize(max_cached_file_size);   
                    if (max_cached_files>=-1)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.