* @return the modified provider URI
* @throws ConfigurationException if <code>uri</code> is invalid
*/
private String getProviderURI(String uri)
throws ConfigurationException {
URI parsed;
try {
parsed = new URI(uri);
String scheme = parsed.getScheme();
if (scheme.equals(HTTP_SCHEME) || scheme.equals(HTTPS_SCHEME)) {
String path = parsed.getPath();
if (path == null || path.length() == 0 || path.equals("/")) {
parsed.setPath(SERVLET);
}
} else if (scheme.equals(EMBEDDED_SCHEME)) {
parsed.setScheme(VM_SCHEME);
parsed.setPath(VM_PATH);
}
} catch (IOException exception) {
throw new ConfigurationException(exception.getMessage());
}
return parsed.toString();
}