Class ResourceContentFactory
java.lang.Object
org.eclipse.jetty.server.ResourceContentFactory
- All Implemented Interfaces:
HttpContent.ContentFactory
An HttpContent.Factory for transient content (not cached). The HttpContent's created by
this factory are not intended to be cached, so memory limits for individual
HttpOutput streams are enforced.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResourceFactoryprivate final MimeTypesprivate final CompressedContentFormat[] -
Constructor Summary
ConstructorsConstructorDescriptionResourceContentFactory(ResourceFactory factory, MimeTypes mimeTypes, CompressedContentFormat[] precompressedFormats) -
Method Summary
Modifier and TypeMethodDescriptiongetContent(String pathInContext, int maxBufferSize) private HttpContenttoString()
-
Field Details
-
_factory
-
_mimeTypes
-
_precompressedFormats
-
-
Constructor Details
-
ResourceContentFactory
public ResourceContentFactory(ResourceFactory factory, MimeTypes mimeTypes, CompressedContentFormat[] precompressedFormats)
-
-
Method Details
-
getContent
- Specified by:
getContentin interfaceHttpContent.ContentFactory- Parameters:
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 theHttpContent.getDirectBuffer()orHttpContent.getIndirectBuffer()calls.- Returns:
- A
HttpContent - Throws:
IOException- if unable to get content
-
load
private HttpContent load(String pathInContext, Resource resource, int maxBufferSize) throws IOException - Throws:
IOException
-
toString
-