Class ConcatBundleResource
- java.lang.Object
-
- org.apache.wicket.request.resource.AbstractResource
-
- org.apache.wicket.resource.bundles.ConcatBundleResource
-
- All Implemented Interfaces:
java.io.Serializable,IStaticCacheableResource,IResource,org.apache.wicket.util.io.IClusterable
public class ConcatBundleResource extends AbstractResource implements IStaticCacheableResource
A resource that concatenates several resources into one download. This resource can only bundleIStaticCacheableResources. The content type of the resource will be that of the first resource that specifies its content type.- Author:
- papegaaij
- 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 ConcatBundleResource(java.util.List<? extends IReferenceHeaderItem> providedResources)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringfindContentType(java.util.List<org.apache.wicket.util.resource.IResourceStream> resources)protected org.apache.wicket.util.time.TimefindLastModified(java.util.List<org.apache.wicket.util.resource.IResourceStream> resources)java.io.SerializablegetCacheKey()get unique caching key for the resource stream produced byIStaticCacheableResource.getResourceStream()ITextResourceCompressorgetCompressor()org.apache.wicket.util.resource.IResourceStreamgetResourceStream()get static resource stream which will be unique to the related caching keyIStaticCacheableResource.getCacheKey()protected booleangetThrowExceptionOnMissingResource()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.protected byte[]readAllResources(java.util.List<org.apache.wicket.util.resource.IResourceStream> resources)voidsetCachingEnabled(boolean enabled)voidsetCompressor(ITextResourceCompressor compressor)-
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
-
-
-
Constructor Detail
-
ConcatBundleResource
public ConcatBundleResource(java.util.List<? extends IReferenceHeaderItem> providedResources)
Construct.- Parameters:
providedResources-
-
-
Method Detail
-
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
-
findContentType
protected java.lang.String findContentType(java.util.List<org.apache.wicket.util.resource.IResourceStream> resources)
-
findLastModified
protected org.apache.wicket.util.time.Time findLastModified(java.util.List<org.apache.wicket.util.resource.IResourceStream> resources)
-
readAllResources
protected byte[] readAllResources(java.util.List<org.apache.wicket.util.resource.IResourceStream> resources) throws java.io.IOException, org.apache.wicket.util.resource.ResourceStreamNotFoundException- Throws:
java.io.IOExceptionorg.apache.wicket.util.resource.ResourceStreamNotFoundException
-
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
-
setCompressor
public void setCompressor(ITextResourceCompressor compressor)
-
getCompressor
public ITextResourceCompressor getCompressor()
-
getThrowExceptionOnMissingResource
protected boolean getThrowExceptionOnMissingResource()
- Returns:
- the result of
ResourceSettings.getThrowExceptionOnMissingResource()
-
-