How?

Here is what I am doing....


CollectionManagementService service = (CollectionManagementService) 
colRoot.getService("CollectionManager", "1.0");
String sCollectionName = "foo";
String sNestedName = sCollectionName + "/" + "bar";
service.createCollection(sCollectionName);

// works fine

service.createCollection(sNestedName);

// fails

The interesting thing to note is.... Code snipped from Xindice 
CollectionImpl.java

    /* see superclass for documentation */
    public org.xmldb.api.base.Collection createCollection(String name, Document 
configuration) throws XMLDBException {
        checkOpen();
        try {
            Configuration config = new 
Configuration(configuration.getDocumentElement(), false);
            col.createCollection(name, config);

            return getChildCollection(name);
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(ErrorCodes.INVALID_COLLECTION,
                                                  FaultCodes.GEN_UNKNOWN,
                                                  "Cannot create child 
collection", e);
        }
    }

That it gets all the way through the col.createCollection( name, config );

but fails in the getCollectionName()....

    public org.xmldb.api.base.Collection getChildCollection(String name) throws 
XMLDBException {

        if (name.indexOf('/') != -1) {
            throw new XMLDBException(ErrorCodes.INVALID_COLLECTION,
                                     "Invalid collection: " + name);
        }


Because it contains a "/" is this intended?




Reply via email to