if ("create".equals(action)) {
Node testing = JcrUtils.getOrAddNode(session.getRootNode(), "testing", "nt:unstructured");
Node servlet = JcrUtils.getOrAddNode(testing, "PathsServlet", "nt:unstructured");
JcrUtils.getOrAddNode(servlet, "foo", "nt:unstructured");
if (session.hasPendingChanges()) {
session.save();
response.setStatus(HttpServletResponse.SC_CREATED);
}
} else if ("delete".equals(action)) {
if (session.nodeExists("/testing/PathsServlet/foo")) {
session.getNode("/testing/PathsServlet/foo").remove();