public class ClasspathHttpResourceFactory extends AbstractHttpResourceFactory
HttpFile
from a ClassLoader
.Modifier and Type | Method and Description |
---|---|
static void |
clearHttpResourceFactories()
Allows clearing the
HttpResourceFactory instances. |
HttpResource |
createHttpResource(ClassPathHttpResourceNode node)
Creates the
HttpResource . |
HttpResource |
createHttpResource(String applicationCanonicalPath)
Creates the
HttpResponse . |
static ByteBuffer |
getHttpResourceContents(String classpathPrefix,
String classPath)
Obtains the contents of the
HttpResource for the class path. |
static ClasspathHttpResourceFactory |
getHttpResourceFactory(String classPathPrefix,
ClassLoader classLoader,
String... defaultDirectoryFileNames)
Obtains the
ClasspathHttpResourceFactory for the class path
prefix. |
ClassPathHttpResourceNode |
getNode(String resourcePath)
Obtains the
ClassPathHttpResourceNode for resource path. |
addHttpFileDescriber, describeFile, getHttpResourceContents
public static ClasspathHttpResourceFactory getHttpResourceFactory(String classPathPrefix, ClassLoader classLoader, String... defaultDirectoryFileNames)
ClasspathHttpResourceFactory
for the class path
prefix.classPathPrefix
- Class path prefix.classLoader
- ClassLoader
to use to obtain the HttpResource
instances.defaultDirectoryFileNames
- Default directory file names. Should the
ClasspathHttpResourceFactory
already be created for
the class path prefix, these values are ignored.ClasspathHttpResourceFactory
for the class path prefix.public static void clearHttpResourceFactories()
HttpResourceFactory
instances.public static ByteBuffer getHttpResourceContents(String classpathPrefix, String classPath)
HttpResource
for the class path.classpathPrefix
- Class path prefix to identify the HttpResourceFactory
.classPath
- Class path to the HttpResource
.HttpResource
.public ClassPathHttpResourceNode getNode(String resourcePath)
ClassPathHttpResourceNode
for resource path.resourcePath
- Resource path.ClassPathHttpResourceNode
for resource path or
null
if no resource.public HttpResource createHttpResource(ClassPathHttpResourceNode node)
HttpResource
.node
- ClassPathHttpResourceNode
for the created
HttpResource
.HttpResource
.public HttpResource createHttpResource(String applicationCanonicalPath) throws IOException
HttpResourceFactory
HttpResponse
.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.