wicket.markup.html
Class CompressedPackageResource

java.lang.Object
  extended by wicket.Resource
      extended by wicket.markup.html.WebResource
          extended by wicket.markup.html.PackageResource
              extended by wicket.markup.html.CompressedPackageResource
All Implemented Interfaces:
java.io.Serializable, IRequestListener, IResourceListener

public final class CompressedPackageResource
extends PackageResource

Identical to PackageResource, but supports gzip compression of data See PackageResource and CompressedResourceReference

Author:
Janne Hietamäki
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class wicket.markup.html.PackageResource
PackageResource.PackageResourceBlockedException
 
Field Summary
 
Fields inherited from class wicket.markup.html.PackageResource
EXTENSION_CSS, EXTENSION_JS
 
Fields inherited from interface wicket.IResourceListener
INTERFACE
 
Constructor Summary
protected CompressedPackageResource(java.lang.Class scope, java.lang.String path, java.util.Locale locale, java.lang.String style)
           
 
Method Summary
static PackageResource get(java.lang.Class scope, java.lang.String path, java.util.Locale locale, java.lang.String style)
          Gets the resource for a given set of criteria.
 IResourceStream getResourceStream()
           
protected  void setHeaders(WebResponse response)
          Subclasses can override this to set there headers when the resource is being served.
 
Methods inherited from class wicket.markup.html.PackageResource
bind, bind, bind, bind, bind, exists, get, get, get, getAbsolutePath, getLocale, getPath, getScope, getStyle
 
Methods inherited from class wicket.markup.html.WebResource
configureResponse
 
Methods inherited from class wicket.Resource
getParameters, invalidate, isCacheable, onResourceRequested, setCacheable, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompressedPackageResource

protected CompressedPackageResource(java.lang.Class scope,
                                    java.lang.String path,
                                    java.util.Locale locale,
                                    java.lang.String style)
Method Detail

get

public static PackageResource get(java.lang.Class scope,
                                  java.lang.String path,
                                  java.util.Locale locale,
                                  java.lang.String style)
Gets the resource for a given set of criteria. Only one resource will be loaded for the same criteria.

Parameters:
scope - This argument will be used to get the class loader for loading the package resource, and to determine what package it is in. Typically this is the class in which you call this method
path - The path to the resource
locale - The locale of the resource
style - The style of the resource (see Session)
Returns:
The resource
Throws:
PackageResourceBlockedException - when the target resource is not accepted by the package resource guard.

getResourceStream

public IResourceStream getResourceStream()
Overrides:
getResourceStream in class PackageResource
Returns:
Gets the resource for the component.

setHeaders

protected void setHeaders(WebResponse response)
Description copied from class: WebResource
Subclasses can override this to set there headers when the resource is being served. By default 2 headers will be set if the Resource is cacheable
 response.setDateHeader("Expires", System.currentTimeMillis() + (3600 * 1000));
 response.setHeader("Cache-Control", "max-age=" + 3600);
 
So if a resource wants to control this or doesn't want to set this info it should override this method and don't call super.

Overrides:
setHeaders in class WebResource
Parameters:
response - The WebResponse where set(Date)Header can be called on.


Copyright © 2004-2007 Wicket developers. All Rights Reserved.