DataSourceResolver
public class DataSourceUrlResolver extends DataSourceBaseResolver
DataSource
based on an URL.Constructor | Description |
---|---|
DataSourceUrlResolver(java.net.URL baseUrl) |
Constructor.
|
DataSourceUrlResolver(java.net.URL baseUrl,
boolean lenient) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
protected java.net.URL |
createUrl(java.lang.String resourceLocation) |
Create an URL based on a base URL and a resource location suitable for loading
the resource.
|
java.net.URL |
getBaseUrl() |
Get the base URL used for resolving relative resource locations.
|
javax.activation.DataSource |
resolve(java.lang.String resourceLocation) |
Resolves the given resource location to a
DataSource . |
javax.activation.DataSource |
resolve(java.lang.String resourceLocation,
boolean isLenient) |
Resolves the given resource location to a
DataSource . |
isCid, isFileUrl, isHttpUrl, isLenient
public DataSourceUrlResolver(java.net.URL baseUrl)
baseUrl
- the base URL used for resolving relative resource locationspublic DataSourceUrlResolver(java.net.URL baseUrl, boolean lenient)
baseUrl
- the base URL used for resolving relative resource locationslenient
- shall we ignore resources not found or complain with an exceptionpublic java.net.URL getBaseUrl()
public javax.activation.DataSource resolve(java.lang.String resourceLocation) throws java.io.IOException
DataSource
.resourceLocation
- the location of the resourceDataSource
java.io.IOException
- the resource was not foundpublic javax.activation.DataSource resolve(java.lang.String resourceLocation, boolean isLenient) throws java.io.IOException
DataSource
.resourceLocation
- the location of the resourceisLenient
- shall we ignore resources not found or complain with an exception?java.io.IOException
- resolving the resource failedprotected java.net.URL createUrl(java.lang.String resourceLocation) throws java.net.MalformedURLException
resourceLocation
- a resource locationjava.net.MalformedURLException
- creating the URL failed