wicket.markup.html
Class CompressedPackageResource
java.lang.Object
wicket.Resource
wicket.markup.html.WebResource
wicket.markup.html.PackageResource
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
Constructor Summary |
protected |
CompressedPackageResource(java.lang.Class scope,
java.lang.String path,
java.util.Locale locale,
java.lang.String style)
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompressedPackageResource
protected CompressedPackageResource(java.lang.Class scope,
java.lang.String path,
java.util.Locale locale,
java.lang.String style)
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 methodpath
- The path to the resourcelocale
- The locale of the resourcestyle
- 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.