public class DefaultURIResolver extends Object implements CollectionURIResolver
Constructor and Description |
---|
DefaultURIResolver() |
Modifier and Type | Method and Description |
---|---|
String |
getCollectionBaseURI()
Get the base URI derived from a schema collection.
|
protected URL |
getFileURL(URL contextURL,
String path)
Method getFileURL
|
protected URL |
getURL(URL contextURL,
String spec)
This is essentially a call to "new URL(contextURL, spec)" with extra handling in case spec is a file.
|
protected boolean |
isAbsolute(String uri)
Find whether a given uri is relative or not
|
InputSource |
resolveEntity(String namespace,
String schemaLocation,
String baseUri)
Try to resolve a schema location to some data.
|
void |
setCollectionBaseURI(String collectionBaseURI)
set the collection base URI, which serves as a fallback from the base of the immediate schema.
|
public InputSource resolveEntity(String namespace, String schemaLocation, String baseUri)
resolveEntity
in interface URIResolver
namespace
- target namespace.schemaLocation
- system ID.baseUri
- base URI for the schema.protected boolean isAbsolute(String uri)
uri
- protected URL getURL(URL contextURL, String spec) throws IOException
contextURL
- spec
- IOException
protected URL getFileURL(URL contextURL, String path) throws IOException
contextURL
- path
- IOException
public String getCollectionBaseURI()
getCollectionBaseURI
in interface CollectionURIResolver
public void setCollectionBaseURI(String collectionBaseURI)
setCollectionBaseURI
in interface CollectionURIResolver
collectionBaseURI
- the URI.Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.