RemoteApp app = new RemoteApp(db,doc.getDocumentElement());
if (app.exists()) {
getResponse().setStatus(Status.CLIENT_ERROR_CONFLICT);
return new StringRepresentation("Remote app with name "+app.getName()+" already exists.");
}
if (app.create()) {
getResponse().setStatus(Status.SUCCESS_NO_CONTENT);
Reference ref = new Reference(getRequest().getResourceRef().toString()+"/"+app.getName());
getResponse().setLocationRef(ref);
return null;
} else {