/** Accepts <tt>config.xml</tt> submission, as well as serve it. */ @WebMethod(name = "config.xml") public void doConfigDotXml(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(Jenkins.ADMINISTER); if (req.getMethod().equals("GET")) { // read rsp.setContentType("application/xml"); Jenkins.XSTREAM2.toXML(getNode(), rsp.getOutputStream()); return; } if (req.getMethod().equals("POST")) { // submission Node result = (Node) Jenkins.XSTREAM2.fromXML(req.getReader()); replaceBy(result); return; } // huh? rsp.sendError(SC_BAD_REQUEST); }