
throws ServletException {</BUG>
if (!isMultipart(request))
throw new ServletException("Not a multipart request!");
<BUG>return request.isAsyncSupported() ? new AsyncUploadParser(request, response) : new BlockingUploadParser(request, response);
}</BUG>
public UploadParser onPartBegin(@Nonnull OnPartBegin partBeginCallback) {
this.partBeginCallback = requireNonNull(partBeginCallback);
return this;
}

public static boolean isMultipart(@Nonnull HttpServletRequest request) {
return POST_METHOD.equalsIgnoreCase(request.getMethod()) && request.getContentType() != null &&
request.getContentType().toLowerCase(Locale.ENGLISH).startsWith(MULTIPART);
}
@CheckReturnValue
public static UploadParser newParser(@Nonnull HttpServletRequest request) throws ServletException {
if (!isMultipart(request))
throw new ServletException("Not a multipart request!");
return request.isAsyncSupported() ? new AsyncUploadParser(request) : new BlockingUploadParser(request);
}
public UploadParser onPartBegin(@Nonnull OnPartBegin partBeginCallback) {
this.partBeginCallback = requireNonNull(partBeginCallback);
return this;
}
