Class FileMappingHttpContentFactory
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.http.content.FileMappingHttpContentFactory
- All Implemented Interfaces:
HttpContent.Factory, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
@ManagedObject
public class FileMappingHttpContentFactory
extends ContainerLifeCycle
implements HttpContent.Factory
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendableNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct aFileMappingHttpContentFactorywhich can use file mapped buffers.FileMappingHttpContentFactory(HttpContent.Factory factory, int minFileSize, int maxBufferSize) Construct aFileMappingHttpContentFactorywhich can use file mapped buffers. -
Method Summary
Modifier and TypeMethodDescriptiongetContent(String path) Get theHttpContentinstance of a path.intintMethods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
FileMappingHttpContentFactory
Construct aFileMappingHttpContentFactorywhich can use file mapped buffers. Uses a default value of 1048576 for the minimum size of anHttpContentbefore trying to use a file mapped buffer.- Parameters:
factory- the wrappedHttpContent.Factoryto use.
-
FileMappingHttpContentFactory
public FileMappingHttpContentFactory(HttpContent.Factory factory, int minFileSize, int maxBufferSize) Construct aFileMappingHttpContentFactorywhich can use file mapped buffers.- Parameters:
factory- the wrappedHttpContent.Factoryto use.minFileSize- the minimum size of anHttpContentbefore trying to use a file mapped buffer; or-1for a default.maxBufferSize- the maximum size of the memory mapped buffers; or-1for a default.
-
-
Method Details
-
getContent
Description copied from interface:HttpContent.FactoryGet theHttpContentinstance of a path.- Specified by:
getContentin interfaceHttpContent.Factory- Parameters:
path- The path.- Returns:
- A
HttpContentinstance. - Throws:
IOException- if unable to get content
-
getMinFileSize
@ManagedAttribute(value="The minimum size of a file before trying to use memory mapping", readonly=true) public int getMinFileSize() -
getMaxBufferSize
@ManagedAttribute(value="The maximum size of the memory mapped buffers", readonly=true) public int getMaxBufferSize()
-