public WebdavContentNode createChild(String name, Type type)
throws ContentRepositoryException
{
// make sure this isn't a path
if (name.contains("/")) {
throw new ContentRepositoryException("Paths not allowed: " + name);
}
try {
HttpURL newURL = getChildURL(getResource().getHttpURL(), name);
logger.fine("[WebdavContentCollection] Create child " + name +
" returns " + newURL + " from " + this);
AuthenticatedWebdavResource newResource =
new AuthenticatedWebdavResource(getResource(), newURL);
if (newResource.exists()) {
throw new ContentRepositoryException("Path " + newURL +
" already exists.");
}
switch (type) {
case COLLECTION:
newResource.mkcolMethod();
break;
case RESOURCE:
break;
}
return getContentNode(newResource);
} catch (IOException ioe) {
throw new ContentRepositoryException(ioe);
}
}