Example usage for io.netty.handler.codec.http.multipart HttpPostRequestDecoder getMultipartDataBoundary

List of usage examples for io.netty.handler.codec.http.multipart HttpPostRequestDecoder getMultipartDataBoundary

Introduction

In this page you can find the example usage for io.netty.handler.codec.http.multipart HttpPostRequestDecoder getMultipartDataBoundary.

Prototype

protected static String[] getMultipartDataBoundary(String contentType) 

Source Link

Document

Check from the request ContentType if this request is a Multipart request.

Usage

From source file:divconq.http.multipart.HttpPostMultipartRequestDecoder.java

License:Apache License

/**
 * Set from the request ContentType the multipartDataBoundary and the possible charset.
 *///from   ww w.  j  av  a2s . c o  m
private void setMultipart(String contentType) {
    String[] dataBoundary = HttpPostRequestDecoder.getMultipartDataBoundary(contentType);
    if (dataBoundary != null) {
        multipartDataBoundary = dataBoundary[0];
        if (dataBoundary.length > 1 && dataBoundary[1] != null) {
            charset = Charset.forName(dataBoundary[1]);
        }
    } else {
        multipartDataBoundary = null;
    }
    currentStatus = MultiPartStatus.HEADERDELIMITER;
}