public class ResourceContentFactory extends java.lang.Object implements HttpContent.ContentFactory
Modifier and Type | Field and Description |
---|---|
private ResourceFactory |
_factory |
private MimeTypes |
_mimeTypes |
private CompressedContentFormat[] |
_precompressedFormats |
Constructor and Description |
---|
ResourceContentFactory(ResourceFactory factory,
MimeTypes mimeTypes,
CompressedContentFormat[] precompressedFormats) |
Modifier and Type | Method and Description |
---|---|
HttpContent |
getContent(java.lang.String pathInContext,
int maxBufferSize) |
private HttpContent |
load(java.lang.String pathInContext,
Resource resource,
int maxBufferSize) |
java.lang.String |
toString() |
private final ResourceFactory _factory
private final MimeTypes _mimeTypes
private final CompressedContentFormat[] _precompressedFormats
public ResourceContentFactory(ResourceFactory factory, MimeTypes mimeTypes, CompressedContentFormat[] precompressedFormats)
public HttpContent getContent(java.lang.String pathInContext, int maxBufferSize) throws java.io.IOException
getContent
in interface HttpContent.ContentFactory
pathInContext
- The path within the context to the resourcemaxBufferSize
- The maximum buffer to allocated for this request. For cached content, a larger buffer may have
previously been allocated and returned by the HttpContent.getDirectBuffer()
or HttpContent.getIndirectBuffer()
calls.HttpContent
java.io.IOException
- if unable to get contentprivate HttpContent load(java.lang.String pathInContext, Resource resource, int maxBufferSize) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object