Top Description Fields Constructors Methods
org.eclipse.jetty.http.content

public Class VirtualHttpContentFactory

extends Object
implements Factory
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.http.content.HttpContent.Factory
Imports
java.io.IOException, org.eclipse.jetty.util.resource.Resource, org.slf4j.Logger, .LoggerFactory

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.

Field Summary

Modifier and TypeField and Description
private final String
private final HttpContent.Factory
private final String
private final Resource
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HttpContent
getContent(String
The path within the context to the resource
path
)

Implements org.eclipse.jetty.http.content.HttpContent.Factory.getContent.

public Resource
getResource()

Returns: Returns the stylesheet as a Resource.

protected boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_contentTypeback to summary
private final String _contentType
_factoryback to summary
private final HttpContent.Factory _factory
_matchSuffixback to summary
private final String _matchSuffix
_resourceback to summary
private final Resource _resource
LOGback to summary
private static final Logger LOG

Constructor Detail

VirtualHttpContentFactoryback to summary
public VirtualHttpContentFactory(HttpContent.Factory factory, Resource resource, String contentType)

Method Detail

getContentback to summary
public HttpContent getContent(String path) throws IOException

Implements org.eclipse.jetty.http.content.HttpContent.Factory.getContent.

Parameters
path:String

Doc from org.eclipse.jetty.http.content.HttpContent.Factory.getContent.

The path within the context to the resource

Returns:HttpContent

Doc from org.eclipse.jetty.http.content.HttpContent.Factory.getContent.

A HttpContent

Annotations
@Override
Exceptions
IOException:

Doc from org.eclipse.jetty.http.content.HttpContent.Factory.getContent.

if unable to get content

getResourceback to summary
public Resource getResource()
Returns:Resource

Returns the stylesheet as a Resource.

matchResourceback to summary
protected boolean matchResource(String path)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override