Retrieves the boundary from the <code>Content-type</code> header.

@param sContentType
The value of the content type header from which to extract the
boundary value.
@return The boundary, as a byte array.
501480
@Nullable
  protected byte [] getBoundary (@Nonnull final String sContentType)
  {
    // Parameter parser can handle null input
    final ICommonsMap <String, String> aParams = new ParameterParser ().setLowerCaseNames (true)
                                                                       .parse (sContentType, new char [] { ';', ',' });
    final String sBoundaryStr = aParams.get ("boundary");
    if (sBoundaryStr == null)
      return null;
    return sBoundaryStr.getBytes (StandardCharsets.ISO_8859_1);
  }
183163
public String getContentType() {
        if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
            checkRequestObjectInUse();
        }
        // 321485
        // PK57679 Start
        String contentType;
        if (!_setInputDataStreamCalled) // 516233
            contentType = _request.getContentType();
        else
            contentType = _setInputStreamContentType;
        // PK57679 End
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"getContentType", "this->"+this+": "+" type --> " + contentType);
        }
        return contentType;
    }
1217012
@Override
    public String getContentType() {
        String type = this.response.getHeader("Content-Type");
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getContentType: " + type);
        }
        return type;
    }
834919
protected function getBoundary()
    {
        $pos = strpos($this->contentType, "boundary=");
        if ($pos === false) {
            throw new DecodeException(
                "missing value for 'boundary' in content-type header"
            );
        }
        return "--" . substr($this->contentType, $pos + 9);
    }
878720
public ContentType getContentType() {
        String contentType = m_headers.get(HttpDefs.CONTENT_TYPE);
        if (contentType == null) {
            return null;
        }
        return new ContentType(contentType);
    }
1049033
private String getContentType(HttpServletRequest pRequest) {
        if (responseMessageTypes != null) {
            String accept = pRequest.getHeader("Accept");

            for (String type : responseMessageTypes) {
                // Note: This is not 100% correct way of doing content negotiation
                // But we just want a compatible result, quick, so this is okay
                if (StringUtil.contains(accept, type)) {
                    return type;
                }
            }
        }

        // If none found, return default
        return DEFAULT_TYPE;
    }
645502
public static JavaType findRootType(JavaType contentType) {

		if (contentType.hasGenericTypes()) {
			return findRootType(contentType.containedType(0));
		} else {
			return contentType;
		}
	}
550930
public byte[] readBoundary() throws IOException {
		ByteArrayOutputStream boundaryOutput = new ByteArrayOutputStream(1024);
		byte b;
		// skip optional whitespaces
		while ((b = readByte()) <= ' ') {
		}
		boundaryOutput.write(b);

		// now read boundary chars
		while ((b = readByte()) != '\r') {
			boundaryOutput.write(b);
		}
		if (boundaryOutput.size() == 0) {
			throw new IOException("Problems with parsing request: invalid boundary");
		}
		skipBytes(1);
		boundary = new byte[boundaryOutput.size() + 2];
		System.arraycopy(boundaryOutput.toByteArray(), 0, boundary, 2, boundary.length - 2);
		boundary[0] = '\r';
		boundary[1] = '\n';
		return boundary;
	}
682498
@Override
  protected Long stringToBoundary(String boundary, Integer segmentNumber)
      throws IOException {
    if (segmentRegistration.equals(SEGMENT_BOUNDARY_ASC)
        || segmentRegistration.equals(SEGMENT_BOUNDARY_DESC)) {
      if (segmentNumber == null) {
        return Long.valueOf(boundary);
      } else {
        return Math.floorDiv(Long.parseLong(boundary), segmentNumber);
      }
    } else {
      throw new IOException(
          "not available for segmentRegistration " + segmentRegistration);
    }
  }
1148067
protected static String[] getMultipartDataBoundary(String contentType) {
        // Check if Post using "multipart/form-data; boundary=--89421926422648 [; charset=xxx]"
        String[] headerContentType = splitHeaderContentType(contentType);
        final String multiPartHeader = HttpHeaderValues.MULTIPART_FORM_DATA.toString();
        if (headerContentType[0].regionMatches(true, 0, multiPartHeader, 0 , multiPartHeader.length())) {
            int mrank;
            int crank;
            final String boundaryHeader = HttpHeaderValues.BOUNDARY.toString();
            if (headerContentType[1].regionMatches(true, 0, boundaryHeader, 0, boundaryHeader.length())) {
                mrank = 1;
                crank = 2;
            } else if (headerContentType[2].regionMatches(true, 0, boundaryHeader, 0, boundaryHeader.length())) {
                mrank = 2;
                crank = 1;
            } else {
                return null;
            }
            String boundary = StringUtil.substringAfter(headerContentType[mrank], '=');
            if (boundary == null) {
                throw new ErrorDataDecoderException("Needs a boundary value");
            }
            if (boundary.charAt(0) == '"') {
                String bound = boundary.trim();
                int index = bound.length() - 1;
                if (bound.charAt(index) == '"') {
                    boundary = bound.substring(1, index);
                }
            }
            final String charsetHeader = HttpHeaderValues.CHARSET.toString();
            if (headerContentType[crank].regionMatches(true, 0, charsetHeader, 0, charsetHeader.length())) {
                String charset = StringUtil.substringAfter(headerContentType[crank], '=');
                if (charset != null) {
                    return new String[] {"--" + boundary, charset};
                }
            }
            return new String[] {"--" + boundary};
        }
        return null;
    }
911596
public boolean isTextContentType(HttpResponse httpResponse) {
        String contentType = HttpResponseUtils.getFirstHeader(HttpHeaders.CONTENT_TYPE, httpResponse);
        return isTextContentType(contentType);
    }
183622
public String getFullContentType() {
        final String url = this.url.toExternalForm().substring("data:".length());
        final int endIndex = url.indexOf(',');
        if (endIndex >= 0) {
            final String contentType = url.substring(0, endIndex);
            if (!contentType.isEmpty()) {
                return contentType;
            }
        }
        return "text/plain;charset=US-ASCII";
    }
255396
def get_content_type (headers):
    
    ptype = headers.get('Content-Type', 'application/octet-stream')
    if ";" in ptype:
        # split off not needed extension info
        ptype = ptype.split(';')[0]
    return ptype.strip().lower()
986237
public MultipartContent part(String fieldName, String contentType, String value) {
        return part(fieldName, null, contentType, value);
    }
126205
public void startPart(String contentType)
         throws IOException
    {
        if (inPart)
            out.write(__CRLF);
        inPart=true;
        out.write(__DASHDASH);
        out.write(boundaryBytes);
        out.write(__CRLF);
        out.write(("Content-Type: "+contentType).getBytes(StringUtil.__ISO_8859_1));
        out.write(__CRLF);
        out.write(__CRLF);
    }
661714
public KieServerHttpRequest contentType(final String contentType, final String charset ) {
        if( charset != null && charset.length() > 0 ) {
            final String separator = "; " + PARAM_CHARSET + '=';
            return header(CONTENT_TYPE, contentType + separator + charset);
        } else
            return header(CONTENT_TYPE, contentType);
    }
279144
public static boolean containsContentType(String contentType, String[] allowedContentTypes)
    {
        if (allowedContentTypes == null)
        {
            return false;
        }
        for (int i = 0; i < allowedContentTypes.length; i++)
        {
            if (allowedContentTypes[i].indexOf(contentType) != -1)
            {
                return true;
            }
        }
        return false;
    }