}
public URIHandler getURIHandler(URI uri, boolean validateURI) throws URIHandlerException {
if (uri.getScheme() == null) {
if (validateURI) {
throw new URIHandlerException(ErrorCode.E0905, uri);
}
else {
return defaultHandler;
}
}
else {
URIHandler handler = cache.get(uri.getScheme());
if (handler == null) {
handler = cache.get("*");
if (handler == null) {
throw new URIHandlerException(ErrorCode.E0904, uri.getScheme(), uri.toString());
}
}
return handler;
}
}