}
throw new DBException(FaultCodes.COL_COLLECTION_NOT_FOUND, "Parent Collection '"+path+"' doesn't exist");
}
String url = "";
Collection collection = null;
if ( CollectionManager.this instanceof Database )
collection = new Collection((Database)CollectionManager.this);
else
collection = new Collection((Collection)CollectionManager.this);
try {
// Do a name check to see if all is well
String n = cfg.getAttribute(NAME);
if ( n == null || n.trim().equals("") )
throw new DBException(FaultCodes.COL_CANNOT_CREATE, "No name specified");
if ( getCollection(n) != null )
throw new DBException(FaultCodes.COL_DUPLICATE_COLLECTION, "Duplicate Collection '"+n+"'");
Configuration colConfig = this.config.getChild(COLLECTIONS, true);
colConfig.add(cfg);
collection.setConfig(cfg);
collection.create();
collections.put(n, collection);
}
catch ( DBException d ) {
throw d;
}