List of usage examples for io.netty.util AsciiString startsWith
public boolean startsWith(CharSequence prefix)
From source file:io.jsync.http.impl.DefaultHttpServerRequest.java
License:Open Source License
@Override public HttpServerRequest expectMultiPart(boolean expect) { if (expect) { String contentType = request.headers().get(HttpHeaderNames.CONTENT_TYPE); if (contentType != null) { HttpMethod method = request.method(); AsciiString lowerCaseContentType = new AsciiString(contentType.toLowerCase()); boolean isURLEncoded = lowerCaseContentType .startsWith(HttpHeaderValues.APPLICATION_X_WWW_FORM_URLENCODED); if ((lowerCaseContentType.startsWith(HttpHeaderValues.MULTIPART_FORM_DATA) || isURLEncoded) && (method.equals(HttpMethod.POST) || method.equals(HttpMethod.PUT) || method.equals(HttpMethod.PATCH))) { decoder = new HttpPostRequestDecoder(new DataFactory(), request); }/*from w w w.j a v a2 s . co m*/ } } else { decoder = null; } return this; }