Search in sources :

Example 1 with IReferenceHeaderItem

use of org.apache.wicket.markup.head.IReferenceHeaderItem in project wicket by apache.

the class ConcatBundleResource method getCacheKey.

@Override
public Serializable getCacheKey() {
    ArrayList<Serializable> key = new ArrayList<>(providedResources.size());
    for (IReferenceHeaderItem curItem : providedResources) {
        Serializable curKey = ((IStaticCacheableResource) curItem.getReference().getResource()).getCacheKey();
        if (curKey == null) {
            reportError(curItem.getReference(), "Unable to get cache key for ");
            return null;
        }
        key.add(curKey);
    }
    return key;
}
Also used : IStaticCacheableResource(org.apache.wicket.request.resource.caching.IStaticCacheableResource) Serializable(java.io.Serializable) ArrayList(java.util.ArrayList) IReferenceHeaderItem(org.apache.wicket.markup.head.IReferenceHeaderItem)

Example 2 with IReferenceHeaderItem

use of org.apache.wicket.markup.head.IReferenceHeaderItem in project wicket by apache.

the class ConcatBundleResource method collectResourceStreams.

private List<IResourceStream> collectResourceStreams() {
    List<IResourceStream> ret = new ArrayList<>(providedResources.size());
    for (IReferenceHeaderItem curItem : providedResources) {
        IResourceStream stream = ((IStaticCacheableResource) curItem.getReference().getResource()).getResourceStream();
        if (stream == null) {
            reportError(curItem.getReference(), "Cannot get resource stream for ");
            return null;
        }
        ret.add(stream);
    }
    return ret;
}
Also used : IStaticCacheableResource(org.apache.wicket.request.resource.caching.IStaticCacheableResource) IResourceStream(org.apache.wicket.util.resource.IResourceStream) ArrayList(java.util.ArrayList) IReferenceHeaderItem(org.apache.wicket.markup.head.IReferenceHeaderItem)

Aggregations

ArrayList (java.util.ArrayList)2 IReferenceHeaderItem (org.apache.wicket.markup.head.IReferenceHeaderItem)2 IStaticCacheableResource (org.apache.wicket.request.resource.caching.IStaticCacheableResource)2 Serializable (java.io.Serializable)1 IResourceStream (org.apache.wicket.util.resource.IResourceStream)1