public class DirectHttpResourceFactory extends Object implements HttpResourceFactory
HttpResourceFactory
to keep HttpFile
and
HttpDirectory
instances in memory with direct ByteBuffer
for
improved performance.Constructor and Description |
---|
DirectHttpResourceFactory(HttpResourceFactory delegate,
String... defaultDirectoryFileNames)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
void |
addHttpFileDescriber(HttpFileDescriber httpFileDescriber)
Adds a
HttpFileDescriber to describe the HttpFile
instances. |
HttpResource |
createHttpResource(String applicationCanonicalPath)
Creates the
HttpResponse . |
public DirectHttpResourceFactory(HttpResourceFactory delegate, String... defaultDirectoryFileNames)
delegate
- Delegate HttpResourceFactory
.defaultDirectoryFileNames
- Default directory file names.public void addHttpFileDescriber(HttpFileDescriber httpFileDescriber)
HttpResourceFactory
Adds a HttpFileDescriber
to describe the HttpFile
instances.
The HttpFileDescriber
instances are to be used in the order
added. Once a HttpFileDescription
is provided, the remaining
HttpFileDescriber
instances will not be used.
addHttpFileDescriber
in interface HttpResourceFactory
httpFileDescriber
- HttpFileDescriber
to describe the HttpFile
.public HttpResource createHttpResource(String applicationCanonicalPath) throws IOException
HttpResourceFactory
HttpResponse
.createHttpResource
in interface HttpResourceFactory
applicationCanonicalPath
- Application canonical path to the HttpResource
. See
the HttpApplicationLocation
for obtaining this path
from the HttpRequest
request URI.HttpResource
.IOException
- If failure in finding the HttpResource
.Copyright © 2005–2016. All rights reserved.