public class ServletResourceLocator extends Object implements ContainerResourceLocator
Constructor and Description |
---|
ServletResourceLocator(javax.servlet.ServletConfig config,
ExternalResourceLocator externalResourceLocator)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
URI |
getBaseURI()
Get the base URI for the locator instance.
|
InputStream |
getResource(String uri)
Get a resource stream through the Servlet container.
|
InputStream |
getResource(String configName,
String defaultUri)
Get a resource stream through the Servlet container.
|
public ServletResourceLocator(javax.servlet.ServletConfig config, ExternalResourceLocator externalResourceLocator)
config
- The ServletConfig instance.externalResourceLocator
- Resource locator for resources outside the Servlet context.public InputStream getResource(String configName, String defaultUri) throws IllegalArgumentException, IOException
ServletParamUtils.getParameterValue(String, ServletConfig)
)
exists for "configName" the method uses use the config value, otherwise
it use the "defaultUri" value provided. Calls
getResource(String)
to get the resource stream.getResource
in interface ContainerResourceLocator
configName
- The container configuration entry name whose value specifies
the location of the resource.defaultUri
- The default location for the resource.IllegalArgumentException
- Illegal argument. Check the cause exception for more
information.IOException
- Unable to get the resource stream.public InputStream getResource(String uri) throws IllegalArgumentException, IOException
ServletContext.getResourceAsStream(java.lang.String)
ExternalResourceLocator.getResource(String)
getResource
in interface ExternalResourceLocator
uri
- The location of the resource to be located.IllegalArgumentException
- Illegal argument. Check the cause exception for more
information.IOException
- Unable to get the org.milyn.resource stream.public URI getBaseURI()
ContainerResourceLocator
getBaseURI
in interface ContainerResourceLocator
Copyright © 2020. All rights reserved.