FileSystemOptions opts = getOptions(url.getProtocol());
file = (opts == null) ? VFS.getManager().resolveFile(url.toString())
: VFS.getManager().resolveFile(url.toString(), opts);
if (file.getType() != FileType.FILE)
{
throw new ConfigurationException("Cannot load a configuration from a directory");
}
FileContent content = file.getContent();
if (content == null)
{
String msg = "Cannot access content of " + file.getName().getFriendlyURI();
throw new ConfigurationException(msg);
}
return content.getInputStream();
}
catch (FileSystemException fse)
{
String msg = "Unable to access " + url.toString();
throw new ConfigurationException(msg, fse);
}
}