public class ResourceStreamerImpl extends Object implements ResourceStreamer
ResourceStreamer.OptionsDEFAULT_OPTIONS| Constructor and Description |
|---|
ResourceStreamerImpl(Request request,
Response response,
StreamableResourceSource streamableResourceSource,
OperationTracker tracker,
boolean productionMode,
ResourceChangeTracker resourceChangeTracker,
String omitExpirationCacheControlHeader,
AssetFactory classpathAssetFactory,
AssetFactory contextAssetFactory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
streamResource(Resource resource,
StreamableResource streamable,
String providedChecksum,
Set<ResourceStreamer.Options> options) |
boolean |
streamResource(Resource resource,
String providedChecksum,
Set<ResourceStreamer.Options> options)
Streams the content of the resource to the client (or sends
an alternative response such as
HttpServletResponse.SC_NOT_MODIFIED). |
boolean |
streamResource(StreamableResource streamable,
String providedChecksum,
Set<ResourceStreamer.Options> options)
Streams a resource that has been assembled elsewhere.
|
public ResourceStreamerImpl(Request request, Response response, StreamableResourceSource streamableResourceSource, OperationTracker tracker, @Symbol(value="tapestry.production-mode") boolean productionMode, ResourceChangeTracker resourceChangeTracker, @Symbol(value="tapestry.omit-expiration-cache-control-header") String omitExpirationCacheControlHeader, @InjectService(value="ClasspathAssetFactory") AssetFactory classpathAssetFactory, @InjectService(value="ContextAssetFactory") AssetFactory contextAssetFactory)
public boolean streamResource(Resource resource, String providedChecksum, Set<ResourceStreamer.Options> options) throws IOException
ResourceStreamerHttpServletResponse.SC_NOT_MODIFIED). Encapsulates logic for compression
and for caching.streamResource in interface ResourceStreamerresource - to streamprovidedChecksum - checksum from URL (or null to not validate against checksum, which is normal for modules)options - enable or disable certain featuresIOExceptionStreamableResourceSourcepublic boolean streamResource(StreamableResource streamable, String providedChecksum, Set<ResourceStreamer.Options> options) throws IOException
ResourceStreamerstreamResource in interface ResourceStreamerstreamable - content to streamprovidedChecksum - checksum provided (in the URL) to validate against the StreamableResource.getChecksum() actual checksum}
for the resource, may be blank to not validate against the checksumoptions - enable or disable certain featuresHttpServletResponse.SC_NOT_MODIFIED response),
or false if the request was not handled (because the provided checksum did not match the actual checksum).IOExceptionpublic boolean streamResource(Resource resource, StreamableResource streamable, String providedChecksum, Set<ResourceStreamer.Options> options) throws IOException
IOException5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.