public class ResourceStreamerImpl extends Object implements ResourceStreamer
ResourceStreamer.Options
DEFAULT_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
ResourceStreamer
HttpServletResponse.SC_NOT_MODIFIED
). Encapsulates logic for compression
and for caching.streamResource
in interface ResourceStreamer
resource
- to streamprovidedChecksum
- checksum from URL (or null to not validate against checksum, which is normal for modules)options
- enable or disable certain featuresIOException
StreamableResourceSource
public boolean streamResource(StreamableResource streamable, String providedChecksum, Set<ResourceStreamer.Options> options) throws IOException
ResourceStreamer
streamResource
in interface ResourceStreamer
streamable
- 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).IOException
public boolean streamResource(Resource resource, StreamableResource streamable, String providedChecksum, Set<ResourceStreamer.Options> options) throws IOException
IOException
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.