public class ResourceStreamResource extends AbstractResource
resource
that loads its data from IResourceStream
AbstractResource.ContentRangeType, AbstractResource.ResourceResponse, AbstractResource.WriteCallback
IResource.Attributes
CONTENT_DISPOSITION_HEADER_NAME, CONTENT_RANGE_ENDBYTE, CONTENT_RANGE_STARTBYTE, INTERNAL_HEADERS
Constructor and Description |
---|
ResourceStreamResource()
Constructor.
|
ResourceStreamResource(IResourceStream stream)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Duration |
getCacheDuration() |
protected IResourceStream |
getResourceStream(IResource.Attributes attributes)
Lazy or dynamic initialization of the wrapped IResourceStream(Writer)
|
protected AbstractResource.ResourceResponse |
newResourceResponse(IResource.Attributes attributes)
Override this method to return a
AbstractResource.ResourceResponse for the request. |
ResourceStreamResource |
setCacheDuration(Duration cacheDuration) |
ResourceStreamResource |
setContentDisposition(ContentDisposition contentDisposition) |
ResourceStreamResource |
setFileName(String fileName) |
ResourceStreamResource |
setTextEncoding(String textEncoding) |
configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
public ResourceStreamResource()
public ResourceStreamResource(IResourceStream stream)
stream
- the resource stream to read frompublic ResourceStreamResource setFileName(String fileName)
fileName
- public ResourceStreamResource setContentDisposition(ContentDisposition contentDisposition)
contentDisposition
- public ResourceStreamResource setTextEncoding(String textEncoding)
textEncoding
- public Duration getCacheDuration()
public ResourceStreamResource setCacheDuration(Duration cacheDuration)
cacheDuration
- the duration for which the resource will be cached by the browserprotected IResourceStream getResourceStream(IResource.Attributes attributes)
attributes
- The request attributesnull
.protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
AbstractResource
AbstractResource.ResourceResponse
for the request.newResourceResponse
in class AbstractResource
attributes
- request attributesCopyright © 2006–2022 Apache Software Foundation. All rights reserved.