(HttpServletRequest request, HttpServletResponse response)
| 363 | |
| 364 | |
| 365 | @Override |
| 366 | public void doPut(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { |
| 367 | |
| 368 | StringManager smClient = StringManager.getManager(Constants.Package, request.getLocales()); |
| 369 | |
| 370 | // Identify the request parameters that we need |
| 371 | String command = request.getPathInfo(); |
| 372 | if (command == null) { |
| 373 | command = request.getServletPath(); |
| 374 | } |
| 375 | String path = request.getParameter("path"); |
| 376 | ContextName cn = null; |
| 377 | if (path != null) { |
| 378 | cn = new ContextName(path, request.getParameter("version")); |
| 379 | } |
| 380 | String config = request.getParameter("config"); |
| 381 | String tag = request.getParameter("tag"); |
| 382 | boolean update = request.getParameter("update") != null && request.getParameter("update").equals("true"); |
| 383 | |
| 384 | // Prepare our output writer to generate the response message |
| 385 | response.setContentType("text/plain;charset=" + Constants.CHARSET); |
| 386 | // Stop older versions of IE thinking they know best. We set text/plain |
| 387 | // in the line above for a reason. IE's behaviour is unwanted at best |
| 388 | // and dangerous at worst. |
| 389 | response.setHeader("X-Content-Type-Options", "nosniff"); |
| 390 | PrintWriter writer = response.getWriter(); |
| 391 | |
| 392 | // Process the requested command |
| 393 | if (command == null) { |
| 394 | writer.println(smClient.getString("managerServlet.noCommand")); |
| 395 | } else if (command.equals("/deploy")) { |
| 396 | deploy(writer, config, cn, tag, update, request, smClient); |
| 397 | } else { |
| 398 | writer.println(smClient.getString("managerServlet.unknownCommand", command)); |
| 399 | } |
| 400 | |
| 401 | // Finish up the response |
| 402 | writer.flush(); |
| 403 | writer.close(); |
| 404 | |
| 405 | } |
| 406 | |
| 407 | |
| 408 | @Override |
nothing calls this directly
no test coverage detected