212213214215216217218219220221222
if (parent == null) { error(request, response, "Cannot delete top-level node."); return null; } parent.removeChild(node.getName()); return parent; } protected ContentNode handleUpload(HttpServletRequest request, HttpServletResponse response,
303304305306307308309310311312313
ContentCollection c = repo.getUserRoot(); try { /* * Remove file if it exists. */ ContentResource r = (ContentResource) c.removeChild(image.getName()); } catch (Exception e) { } ContentResource r = (ContentResource) c.createChild( image.getName(), ContentNode.Type.RESOURCE);