Class VirtualHttpContentFactory

java.lang.Object
org.eclipse.jetty.http.content.VirtualHttpContentFactory
All Implemented Interfaces:
HttpContent.Factory

public class VirtualHttpContentFactory extends Object implements 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 Details

    • VirtualHttpContentFactory

      public VirtualHttpContentFactory(HttpContent.Factory factory, org.eclipse.jetty.util.resource.Resource resource, String contentType)
  • Method Details

    • getResource

      public org.eclipse.jetty.util.resource.Resource getResource()
      Returns:
      Returns the stylesheet as a Resource.
    • getContent

      public HttpContent getContent(String path) throws IOException
      Specified by:
      getContent in interface HttpContent.Factory
      Parameters:
      path - The path within the context to the resource
      Returns:
      A HttpContent
      Throws:
      IOException - if unable to get content
    • matchResource

      protected boolean matchResource(String path)
    • toString

      public String toString()
      Overrides:
      toString in class Object