public class DataSourceUrlResolver extends DataSourceBaseResolver
DataSource
based on an URL.Constructor and Description |
---|
DataSourceUrlResolver(URL baseUrl)
Constructor.
|
DataSourceUrlResolver(URL baseUrl,
boolean lenient)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected URL |
createUrl(String resourceLocation)
Create an URL based on a base URL and a resource location suitable for loading
the resource.
|
URL |
getBaseUrl()
Get the base URL used for resolving relative resource locations.
|
DataSource |
resolve(String resourceLocation)
Resolves the given resource location to a
DataSource . |
DataSource |
resolve(String resourceLocation,
boolean isLenient)
Resolves the given resource location to a
DataSource . |
isCid, isFileUrl, isHttpUrl, isLenient
public DataSourceUrlResolver(URL baseUrl)
baseUrl
- the base URL used for resolving relative resource locationspublic DataSourceUrlResolver(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 URL getBaseUrl()
public DataSource resolve(String resourceLocation) throws IOException
DataSource
.resourceLocation
- the location of the resourceDataSource
IOException
- the resource was not foundpublic DataSource resolve(String resourceLocation, boolean isLenient) throws IOException
DataSource
.resourceLocation
- the location of the resourceisLenient
- shall we ignore resources not found or complain with an exception?IOException
- resolving the resource failedprotected URL createUrl(String resourceLocation) throws MalformedURLException
resourceLocation
- a resource locationMalformedURLException
- creating the URL failedCopyright © 2001–2017 The Apache Software Foundation. All rights reserved.