public ProtectionRequestWrapper(HttpServletRequest request, int max) throws ServletException { super(request); // check multipart String contentType = request.getContentType(); if (contentType == null || !contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART)) { throw new ServletException("Invalid multipart request!"); } // get boundary boundary = MimeHelper.getBoundaryFromMultiPart(contentType); if (boundary == null) { throw new ServletException("Invalid multipart request!"); } // set up checked stream try { messageMax = max; orgStream = super.getInputStream(); checkedStream = new CheckServletInputStream(); } catch (IOException e) { throw new ServletException(e); } }
byte[] extractedBoundary = MimeHelper.getBoundaryFromMultiPart(requestContentType); if (extractedBoundary == null) { throw new CmisInvalidArgumentException("Invalid multipart request!");