org.apache.wicket.request.resource
Class ContextRelativeResource

java.lang.Object
  extended by org.apache.wicket.request.resource.AbstractResource
      extended by org.apache.wicket.request.resource.ContextRelativeResource
All Implemented Interfaces:
Serializable, IStaticCacheableResource, IResource, 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.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
INTERNAL_HEADERS
 
Constructor Summary
ContextRelativeResource(String pathRelativeToContextRoot)
          Construct.
 
Method Summary
 boolean equals(Object obj)
           
 IResourceStream getCacheableResourceStream()
          get static resource stream which will be unique to the related caching key IStaticCacheableResource.getCacheKey()
 Serializable getCacheKey()
          get unique caching key for the resource stream produced by IStaticCacheableResource.getCacheableResourceStream()
 int hashCode()
           
 boolean isCachingEnabled()
          controls whether caching of the resource is enabled or disabled
protected  AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
          Override this method to return a AbstractResource.ResourceResponse for the request.
 void setCachingEnabled(boolean enabled)
           
 
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, flushResponseAfterHeaders, getCachingStrategy, respond, setResponseHeaders
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.request.resource.IResource
respond
 

Constructor Detail

ContextRelativeResource

public ContextRelativeResource(String pathRelativeToContextRoot)
Construct.

Parameters:
pathRelativeToContextRoot -
Method Detail

isCachingEnabled

public boolean isCachingEnabled()
Description copied from interface: IStaticCacheableResource
controls whether caching of the resource is enabled or disabled

Specified by:
isCachingEnabled in interface IStaticCacheableResource
Returns:
@{code true} if caching is enabled

setCachingEnabled

public void setCachingEnabled(boolean enabled)

getCacheKey

public Serializable getCacheKey()
Description copied from interface: IStaticCacheableResource
get unique caching key for the resource stream produced by IStaticCacheableResource.getCacheableResourceStream()

Specified by:
getCacheKey in interface IStaticCacheableResource
Returns:
serializable key with properly supports #equals(Object) and #hashCode()

getCacheableResourceStream

public IResourceStream getCacheableResourceStream()
Description copied from interface: IStaticCacheableResource
get static resource stream which will be unique to the related caching key IStaticCacheableResource.getCacheKey()

Specified by:
getCacheableResourceStream in interface IStaticCacheableResource
Returns:
stream or null if no stream could be found

newResourceResponse

protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
Description copied from class: AbstractResource
Override this method to return a AbstractResource.ResourceResponse for the request.

Specified by:
newResourceResponse in class AbstractResource
Parameters:
attributes - request attributes
Returns:
resource data instance

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.