public boolean consume(HttpServletRequest httpRequest,
                           HttpServletResponse httpResponse) throws IOException {
        try {
            if (consumeWithFileResourceHandlers(httpRequest, httpResponse)) {
                return true;
            }

        } catch (DirectoryTraversal.DirectoryTraversalDetection directoryTraversalDetection) {
            httpResponse.setStatus(400);
            httpResponse.getWriter().write("Bad request");
            httpResponse.getWriter().flush();
            LOG.warn(directoryTraversalDetection.getMessage() + " directory traversal detection for path: "
                             + httpRequest.getPathInfo());
        }
        return false;
    }
public boolean consume ( HttpServletRequest httpRequest , HttpServletResponse httpResponse ) throws IOException { try { if ( consumeWithFileResourceHandlers ( httpRequest , httpResponse ) ) { return true ; } } catch ( DirectoryTraversal . DirectoryTraversalDetection directoryTraversalDetection ) { httpResponse . setStatus ( 400 ) ; httpResponse . getWriter ( ) . write ( "Bad request" ) ; httpResponse . getWriter ( ) . flush ( ) ; LOG . warn ( directoryTraversalDetection . getMessage ( ) + " directory traversal detection for path: " + httpRequest . getPathInfo ( ) ) ; } return false ; }
Attempt consuming using either static resource handlers or jar resource handlers

@param httpRequest  The HTTP servlet request.
@param httpResponse The HTTP servlet response.
@return true if consumed, false otherwise.
@throws IOException in case of IO error.