Class ContextRelativeResource
- java.lang.Object
-
- org.apache.wicket.request.resource.AbstractResource
-
- org.apache.wicket.request.resource.ContextRelativeResource
-
- All Implemented Interfaces:
java.io.Serializable,IStaticCacheableResource,IResource,org.apache.wicket.util.io.IClusterable
public class ContextRelativeResource extends AbstractResource implements IStaticCacheableResource
Resource served from a file relative to the context root.- Author:
- almaw
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource
AbstractResource.ContentRangeType, AbstractResource.ResourceResponse, AbstractResource.WriteCallback
-
Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource
IResource.Attributes
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.request.resource.AbstractResource
CONTENT_DISPOSITION_HEADER_NAME, CONTENT_RANGE_ENDBYTE, CONTENT_RANGE_STARTBYTE, INTERNAL_HEADERS
-
-
Constructor Summary
Constructors Constructor Description ContextRelativeResource(java.lang.String pathRelativeToContextRoot)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.io.SerializablegetCacheKey()get unique caching key for the resource stream produced byIStaticCacheableResource.getResourceStream()org.apache.wicket.util.resource.IResourceStreamgetResourceStream()get static resource stream which will be unique to the related caching keyIStaticCacheableResource.getCacheKey()inthashCode()booleanisCachingEnabled()controls whether caching of the resource is enabled or disabledprotected AbstractResource.ResourceResponsenewResourceResponse(IResource.Attributes attributes)Override this method to return aAbstractResource.ResourceResponsefor the request.voidsetCachingEnabled(boolean enabled)-
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
-
-
-
Method Detail
-
isCachingEnabled
public boolean isCachingEnabled()
Description copied from interface:IStaticCacheableResourcecontrols whether caching of the resource is enabled or disabled- Specified by:
isCachingEnabledin interfaceIStaticCacheableResource- Returns:
-
setCachingEnabled
public void setCachingEnabled(boolean enabled)
-
getCacheKey
public java.io.Serializable getCacheKey()
Description copied from interface:IStaticCacheableResourceget unique caching key for the resource stream produced byIStaticCacheableResource.getResourceStream()- Specified by:
getCacheKeyin interfaceIStaticCacheableResource- Returns:
- serializable key with properly supports
#equals(Object)and#hashCode()
-
getResourceStream
public org.apache.wicket.util.resource.IResourceStream getResourceStream()
Description copied from interface:IStaticCacheableResourceget static resource stream which will be unique to the related caching keyIStaticCacheableResource.getCacheKey()- Specified by:
getResourceStreamin interfaceIStaticCacheableResource- Returns:
- stream or
nullif no stream could be found
-
newResourceResponse
protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
Description copied from class:AbstractResourceOverride this method to return aAbstractResource.ResourceResponsefor the request.- Specified by:
newResourceResponsein classAbstractResource- Parameters:
attributes- request attributes- Returns:
- resource data instance
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-