protected boolean mayService()

in src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java [132:158]


    protected boolean mayService(@NotNull SlingHttpServletRequest request,
            @NotNull SlingHttpServletResponse response) throws ServletException,
            IOException {

        // assume the method is known for now
        if (super.mayService(request, response)) {
            return true;
        }

        // assume the method is known for now
        boolean methodKnown = true;

        String method = request.getMethod();
        if (HttpConstants.METHOD_POST.equals(method)) {
            doPost(request, response);
        } else if (HttpConstants.METHOD_PUT.equals(method)) {
            doPut(request, response);
        } else if (HttpConstants.METHOD_DELETE.equals(method)) {
            doDelete(request, response);
        } else {
            // actually we do not know the method
            methodKnown = false;
        }

        // return whether we actually knew the request method or not
        return methodKnown;
    }