String[] urlParts = checkSyntax(iRequest.url, 3, "Syntax error: class/<database>/<class-name>");
iRequest.data.commandInfo = "Create class";
iRequest.data.commandDetail = urlParts[2];
ODatabaseDocumentTx db = null;
try {
db = getProfiledDatabaseInstance(iRequest);
if (db.getMetadata().getSchema().getClass(urlParts[2]) != null)
throw new IllegalArgumentException("Class '" + urlParts[2] + "' already exists");
final OClass cls = db.getMetadata().getSchema().createClass(urlParts[2]);
db.getMetadata().getSchema().save();
sendTextContent(iRequest, OHttpUtils.STATUS_CREATED_CODE, OHttpUtils.STATUS_CREATED_DESCRIPTION, null,
OHttpUtils.CONTENT_TEXT_PLAIN, cls.getId());
} finally {