Class FileMappingHttpContentFactory
java.lang.Object
org.eclipse.jetty.http.content.FileMappingHttpContentFactory
- All Implemented Interfaces:
HttpContent.Factory
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct aFileMappingHttpContentFactory
which can use file mapped buffers.FileMappingHttpContentFactory
(HttpContent.Factory factory, int minFileSize, int maxBufferSize) Construct aFileMappingHttpContentFactory
which can use file mapped buffers. -
Method Summary
Modifier and TypeMethodDescriptiongetContent
(String path) Get theHttpContent
instance of a path.
-
Constructor Details
-
FileMappingHttpContentFactory
Construct aFileMappingHttpContentFactory
which can use file mapped buffers. Uses a default value of 1048576 for the minimum size of anHttpContent
before trying to use a file mapped buffer.- Parameters:
factory
- the wrappedHttpContent.Factory
to use.
-
FileMappingHttpContentFactory
public FileMappingHttpContentFactory(HttpContent.Factory factory, int minFileSize, int maxBufferSize) Construct aFileMappingHttpContentFactory
which can use file mapped buffers.- Parameters:
factory
- the wrappedHttpContent.Factory
to use.minFileSize
- the minimum size of anHttpContent
before trying to use a file mapped buffer; or-1
for a default.maxBufferSize
- the maximum size of the memory mapped buffers; or-1
for a default.
-
-
Method Details
-
getContent
Description copied from interface:HttpContent.Factory
Get theHttpContent
instance of a path.- Specified by:
getContent
in interfaceHttpContent.Factory
- Parameters:
path
- The path.- Returns:
- A
HttpContent
instance. - Throws:
IOException
- if unable to get content
-