Class ConcatBundleResource
- java.lang.Object
-
- org.apache.wicket.request.resource.AbstractResource
-
- org.apache.wicket.resource.bundles.ConcatBundleResource
-
- All Implemented Interfaces:
Serializable
,IStaticCacheableResource
,IResource
,IClusterable
public class ConcatBundleResource extends AbstractResource implements IStaticCacheableResource
A resource that concatenates several resources into one download. This resource can only bundleIStaticCacheableResource
s. 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(List<? extends IReferenceHeaderItem> providedResources)
Construct.
-
Method Summary
-
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
-
-
-
Constructor Detail
-
ConcatBundleResource
public ConcatBundleResource(List<? extends IReferenceHeaderItem> providedResources)
Construct.- Parameters:
providedResources
-
-
-
Method Detail
-
newResourceResponse
protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
Description copied from class:AbstractResource
Override this method to return aAbstractResource.ResourceResponse
for the request.- Specified by:
newResourceResponse
in classAbstractResource
- Parameters:
attributes
- request attributes- Returns:
- resource data instance
-
findContentType
protected String findContentType(List<IResourceStream> resources)
-
findLastModified
protected Instant findLastModified(List<IResourceStream> resources)
-
readAllResources
protected byte[] readAllResources(List<IResourceStream> resources) throws IOException, ResourceStreamNotFoundException
-
isCachingEnabled
public boolean isCachingEnabled()
Description copied from interface:IStaticCacheableResource
controls whether caching of the resource is enabled or disabled- Specified by:
isCachingEnabled
in interfaceIStaticCacheableResource
- Returns:
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 byIStaticCacheableResource.getResourceStream()
- Specified by:
getCacheKey
in interfaceIStaticCacheableResource
- Returns:
- serializable key which properly supports
Object.equals(Object)
andObject.hashCode()
-
getResourceStream
public IResourceStream getResourceStream()
Description copied from interface:IStaticCacheableResource
get static resource stream which will be unique to the related caching keyIStaticCacheableResource.getCacheKey()
- Specified by:
getResourceStream
in interfaceIStaticCacheableResource
- Returns:
- stream or
null
if 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()
-
-