use of org.eclipse.scout.rt.server.commons.servlet.cache.IHttpResponseInterceptor in project scout.rt by eclipse.
the class DynamicResourceLoader method loadResource.
@Override
public HttpCacheObject loadResource(HttpCacheKey cacheKey) {
DynamicResourceInfo info = createDynamicResourceInfo(cacheKey);
if (info == null) {
LOG.warn("invalid dynamic-resource request received.", new Exception("origin"));
return null;
}
IBinaryResourceProvider provider = getBinaryResourceProvider(info.getUiSession(), info.getJsonAdapterId());
if (provider == null) {
return null;
}
BinaryResourceHolder localResourceHolder = provider.provideBinaryResource(info.getFileName());
if (localResourceHolder == null || localResourceHolder.get() == null) {
return null;
}
BinaryResource localResource = localResourceHolder.get();
BinaryResource httpResource = localResource.createAlias(cacheKey.getResourcePath());
HttpCacheObject httpCacheObject = new HttpCacheObject(cacheKey, httpResource);
for (IHttpResponseInterceptor interceptor : localResourceHolder.getHttpResponseInterceptors()) {
httpCacheObject.addHttpResponseInterceptor(interceptor);
}
return httpCacheObject;
}
Aggregations