Package org.eclipse.jetty.http.content
Class VirtualHttpContentFactory
java.lang.Object
org.eclipse.jetty.http.content.VirtualHttpContentFactory
- All Implemented Interfaces:
HttpContent.Factory
An
HttpContent.Factory
implementation which takes a Resource and fakes this resource as
an entry in every directory. If any request is made for this resources file name, and it is not
already present in that directory then the resource contained in this factory will be served instead.-
Constructor Summary
ConstructorDescriptionVirtualHttpContentFactory
(HttpContent.Factory factory, Resource resource, String contentType) -
Method Summary
Modifier and TypeMethodDescriptiongetContent
(String path) protected boolean
matchResource
(String path) toString()
-
Constructor Details
-
VirtualHttpContentFactory
public VirtualHttpContentFactory(HttpContent.Factory factory, Resource resource, String contentType)
-
-
Method Details
-
getResource
- Returns:
- Returns the stylesheet as a Resource.
-
getContent
- Specified by:
getContent
in interfaceHttpContent.Factory
- Parameters:
path
- The path within the context to the resource- Returns:
- A
HttpContent
- Throws:
IOException
- if unable to get content
-
matchResource
-
toString
-