*/
static public DataStore create(String url) throws DataStoreFatalException {
//
// parse data store url
//
URL parsedUrl = null;
try {
parsedUrl = URLParser.parse(url);
} catch (MalformedURLException e) {
throw new DataStoreFatalException("Unable to parse URL: " + url, e);
}
//
// the "host" is the data store "name"
//
String dataStoreName = parsedUrl.getHost();
if (dataStoreName == null) {
throw new DataStoreFatalException("The host portion of the DataStore URL needs to include the name of the DataStore");
}
//
// convert url protocol to the underlying implementation
//
//DataStoreProtocol protocol = DataStoreProtocol.parseProtocol(parsedUrl.getProtocol());
Class<? extends DataStore> dataStoreClass = providers.get(parsedUrl.getProtocol());
if (dataStoreClass == null) {
throw new DataStoreFatalException("Unable to load DataStore provider for '" + parsedUrl.getProtocol() + "'. Probably not a valid provider?");
}
DataStore ds = null;
try {
ds = dataStoreClass.newInstance();
} catch (Exception e) {
throw new DataStoreFatalException("Unable to load data store class '" + dataStoreClass + "'");
}
Properties props = parsedUrl.getQueryProperties();
// create a temporary xml configuration in-memory to take advantage of
// the ability for an Xbean to auto configure an object
if (props != null) {
StringBuilder xml = new StringBuilder(200);