Package org.apache.wicket.request.resource.caching

Examples of org.apache.wicket.request.resource.caching.ResourceUrl


        // should be stripped of timestamps
        if (i + 1 == segmentsSize)
        {
          // The filename + parameters eventually contain caching
          // related information which needs to be removed
          ResourceUrl resourceUrl = new ResourceUrl(segment, pageParameters);
          getCachingStrategy().undecorateUrl(resourceUrl);
          segment = resourceUrl.getFileName();

          if (Strings.isEmpty(segment))
            throw new NullPointerException(
              "caching strategy must not return an empty filename");
        }
View Full Code Here


        String token = tokens.nextToken();

        // on the last component of the resource path add the timestamp
        if (tokens.hasMoreTokens() == false)
        {
          ResourceUrl resourceUrl = new ResourceUrl(token, parameters);
          getCachingStrategy().decorateUrl(resourceUrl, reference);
          token = resourceUrl.getFileName();

          if (Strings.isEmpty(token))
            throw new NullPointerException(
              "caching strategy must not return an empty filename");
View Full Code Here

                parameters = extractPageParameters(
                    request,
                    this.mountSegments.length,
                    this.parametersEncoder);
               
                ResourceUrl resourceUrl = new ResourceUrl(segment, parameters);
                this.cachingStrategy.get().undecorateUrl(resourceUrl);
                segment = resourceUrl.getFileName();
            }
            if(!segment.equals(this.mountSegments[i]))
            {
                return null;
            }
View Full Code Here

        return encodePageParameters(url, parameters, this.parametersEncoder);
    }
   
    protected String applyCachingStrategy(String fileName, PageParameters parameters)
    {
        ResourceUrl resourceUrl = new ResourceUrl(fileName, parameters);
        ResourceReference lastMod = getLastModifiedReference();
        IResource res = lastMod.getResource();
        if(res instanceof IStaticCacheableResource)
        {
            this.cachingStrategy.get().decorateUrl(resourceUrl, (IStaticCacheableResource) res);
        }
        return resourceUrl.getFileName();
    }
View Full Code Here

        // remove caching information
        if (i + 1 == segmentsSize && Strings.isEmpty(segment) == false)
        {
          // The filename + parameters eventually contain caching
          // related information which needs to be removed
          ResourceUrl resourceUrl = new ResourceUrl(segment, pageParameters);
          getCachingStrategy().undecorateUrl(resourceUrl);
          segment = resourceUrl.getFileName();

          if (Strings.isEmpty(segment))
          {
            throw new IllegalStateException("caching strategy returned empty name for " + resourceUrl);
          }
View Full Code Here

          // apply caching if required
          if (resource instanceof IStaticCacheableResource)
          {
            // add caching related information to filename + query parameters
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
            final ResourceUrl resourceUrl = new ResourceUrl(token, parameters);
            getCachingStrategy().decorateUrl(resourceUrl, cacheable);
            token = resourceUrl.getFileName();

            if (Strings.isEmpty(token))
            {
              throw new IllegalStateException("caching strategy returned empty name for " + resource);
            }
View Full Code Here

      final IResource resource = resourceReference.getResource();

      if (resource instanceof IStaticCacheableResource)
      {
        final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
        final ResourceUrl cacheUrl = new ResourceUrl(filename, parameters);

        getCachingStrategy().decorateUrl(cacheUrl, cacheable);

        if (Strings.isEmpty(cacheUrl.getFileName()))
        {
          throw new IllegalStateException("caching strategy returned empty name for " + resource);
        }
        segments.set(lastSegmentAt, cacheUrl.getFileName());
      }
    }
  }
View Full Code Here

      {
        return;
      }
     
      // create resource url from filename and query parameters
      final ResourceUrl resourceUrl = new ResourceUrl(filename, parameters);

      // remove caching information from request
      getCachingStrategy().undecorateUrl(resourceUrl);
     
      // check for broken caching strategy (this must never happen)
      if (Strings.isEmpty(resourceUrl.getFileName()))
      {
        throw new IllegalStateException("caching strategy returned empty name for " + resourceUrl);
      }

      segments.set(lastSegmentAt, resourceUrl.getFileName());
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.resource.caching.ResourceUrl

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.