MCPcopy Create free account
hub / github.com/apache/tomcat / doPut

Method doPut

java/org/apache/catalina/manager/ManagerServlet.java:365–405  ·  view source on GitHub ↗
(HttpServletRequest request, HttpServletResponse response)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 14

getManagerMethod · 0.95
getStringMethod · 0.95
deployMethod · 0.95
getLocalesMethod · 0.65
getPathInfoMethod · 0.65
getServletPathMethod · 0.65
getParameterMethod · 0.65
equalsMethod · 0.65
setContentTypeMethod · 0.65
setHeaderMethod · 0.65
getWriterMethod · 0.65
flushMethod · 0.65

Tested by

no test coverage detected