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

Method service

java/org/apache/catalina/servlets/WebdavServlet.java:589–629  ·  view source on GitHub ↗
(HttpServletRequest req, HttpServletResponse resp)

Source from the content-addressed store, hash-verified

587
588
589 @Override
590 protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
591
592 final String path = getRelativePath(req);
593
594 // Error page check needs to come before special path check since
595 // custom error pages are often located below WEB-INF so they are
596 // not directly accessible.
597 if (req.getDispatcherType() == DispatcherType.ERROR) {
598 doGet(req, resp);
599 return;
600 }
601
602 // Block access to special subdirectories.
603 // DefaultServlet assumes it services resources from the root of the web app
604 // and doesn't add any special path protection
605 // WebdavServlet remounts the webapp under a new path, so this check is
606 // necessary on all methods (including GET).
607 if (isSpecialPath(path)) {
608 resp.sendError(WebdavStatus.SC_NOT_FOUND);
609 return;
610 }
611
612 final String method = req.getMethod();
613
614 if (debug > 0) {
615 log("[" + method + "] " + path);
616 }
617
618 switch (method) {
619 case Method.PROPFIND -> doPropfind(req, resp);
620 case Method.PROPPATCH -> doProppatch(req, resp);
621 case Method.MKCOL -> doMkcol(req, resp);
622 case Method.COPY -> doCopy(req, resp);
623 case Method.MOVE -> doMove(req, resp);
624 case Method.LOCK -> doLock(req, resp);
625 case Method.UNLOCK -> doUnlock(req, resp);
626 // DefaultServlet processing
627 default -> super.service(req, resp);
628 }
629 }
630
631
632 @Override

Callers

nothing calls this directly

Calls 15

getRelativePathMethod · 0.95
isSpecialPathMethod · 0.95
doPropfindMethod · 0.95
doProppatchMethod · 0.95
doMkcolMethod · 0.95
doCopyMethod · 0.95
doMoveMethod · 0.95
doLockMethod · 0.95
doUnlockMethod · 0.95
getDispatcherTypeMethod · 0.65
sendErrorMethod · 0.65
getMethodMethod · 0.65

Tested by

no test coverage detected