public class MockContainerResourceLocator extends Object implements ContainerResourceLocator
Modifier and Type | Field and Description |
---|---|
static File |
TEST_STANDALONE_CTX_BASE |
Constructor and Description |
---|
MockContainerResourceLocator() |
Modifier and Type | Method and Description |
---|---|
URI |
getBaseURI()
Get the base URI for the locator instance.
|
InputStream |
getResource(String uri)
Get the stream specified by the 'uri' parameter.
|
InputStream |
getResource(String configName,
String defaultUri)
Get the resource specified by the container 'config' value.
|
void |
setResource(String nameOrUri,
InputStream stream) |
public static final File TEST_STANDALONE_CTX_BASE
public void setResource(String nameOrUri, InputStream stream)
public InputStream getResource(String configName, String defaultUri) throws IllegalArgumentException, IOException
ContainerResourceLocator
If the config value isn't specified, uses the defaultLocation.
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
ExternalResourceLocator
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.