When content type has multiple lines this method just returns plain content type information in first line.
This is the case when multipart mixed content type has boundary information in next line.
@param contentType
@return
@throws IOException
341628
static String parseContentType(String contentType) throws IOException {
        if (contentType.indexOf(System.getProperty("line.separator")) > 0) {
            BufferedReader reader = new BufferedReader(new StringReader(contentType));

            try {
                String plainContentType = reader.readLine();
                if (plainContentType != null && plainContentType.trim().endsWith(";")) {
                    plainContentType = plainContentType.trim().substring(0, plainContentType.length() - 1);
                }

                return plainContentType;
            } finally {
                try {
                    reader.close();
                } catch (IOException e) {
                    log.warn("Failed to close reader", e);
                }
            }
        }

        return contentType;
    }
5954
@Trivial
    @Override
    public String getContentType() {
        String type = this.request.getHeader("Content-Type");
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getContentType: " + type);
        }
        return type;
    }
767841
public void setContentType(String contentType) throws InvalidArgumentException {
    if (Strings.isNullOrEmpty(contentType)) {
      throw new InvalidArgumentException("empty content type");
    }

    this.contentType = 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;
    }
139525
public static byte getSerializeTypeByContentType(String contentType) throws SofaRpcException {
        if (StringUtils.isNotBlank(contentType)) {
            String ct = contentType.toLowerCase();
            if (ct.contains("text/plain") || ct.contains("text/html") || ct.contains("application/json")) {
                return getSerializeTypeByName(RpcConstants.SERIALIZE_JSON);
            } else if (ct.contains(RpcConstants.SERIALIZE_PROTOBUF)) {
                return getSerializeTypeByName(RpcConstants.SERIALIZE_PROTOBUF);
            } else if (ct.contains(RpcConstants.SERIALIZE_HESSIAN)) {
                return getSerializeTypeByName(RpcConstants.SERIALIZE_HESSIAN2);
            }
        }
        throw new SofaRpcException(RpcErrorType.SERVER_DESERIALIZE, "Unsupported content type " + contentType
            + " in http protocol, please set HTTP HEAD: '" + RemotingConstants.HEAD_SERIALIZE_TYPE + "'.");
    }
806486
@Override
	protected boolean copyRequestedContentToResponse(String requestedPath, HttpServletResponse response,
			String contentType) throws IOException {

		boolean copyDone = false;
		if (isValidRequestedPath(requestedPath)) {

			try {
				writeContent(requestedPath, null, response);
				response.setContentType(contentType);
				copyDone = true;
			} catch (ResourceNotFoundException e) {
				// Nothing to do here
			}
		}

		return copyDone;
	}
711357
private static String extractContentType(String line) throws IOException {
    // Convert the line to a lowercase string
    line = line.toLowerCase();

    // Get the content type, if any
    // Note that Opera at least puts extra info after the type, so handle
    // that.  For example:  Content-Type: text/plain; name="foo"
    // Thanks to Leon Poyyayil, leon.poyyayil@trivadis.com, for noticing this.
    int end = line.indexOf(";");
    if (end == -1) {
      end = line.length();
    }

    return line.substring(13, end).trim();  // "content-type:" is 13
  }
1373377
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;
    }
864546
private String getMediaType(String contentType) {
        if (contentType == null) {
            return null;
        }
        String result = contentType.toLowerCase(Locale.ENGLISH);
        int firstSemiColonIndex = result.indexOf(';');
        if (firstSemiColonIndex > -1) {
            result = result.substring(0, firstSemiColonIndex);
        }
        result = result.trim();
        return result;
    }
930069
public Message contentType(String contentType) {
        basicProperties = basicProperties.builder()
                .contentType(contentType)
                .build();
        return this;
    }
624336
public static boolean isMultipartContent (@Nullable final String sContentType)
  {
    return sContentType != null && sContentType.toLowerCase (Locale.US).startsWith (MULTIPART);
  }
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;
    }
370982
public static void checkContentType(String contentType) {
    Preconditions.checkArgument(contentType != null); // for backwards compatibility
    Preconditions.checkArgument(
        HttpMediaType.equalsIgnoreParameters(MEDIA_TYPE, contentType),
        "Wrong content type: expected <" + MEDIA_TYPE + "> but got <%s>",
        contentType);
  }
1030468
public Part<T> contentType(String contentType) {
        requireNonNull(contentType);
        return new Part<>(name, fileName, body, contentType, charset, partWriter);
    }
194916
public static MessageProtocol fromContentTypeHeader(Optional<String> contentType) {
        return contentType.map(ct -> {
            String[] parts = ct.split(";");
            String justContentType = parts[0];
            Optional<String> charset = Optional.empty();
            for (int i = 1; i < parts.length; i++) {
                String toTest = parts[i].trim();
                if (toTest.startsWith("charset=")) {
                    charset = Optional.of(toTest.split("=", 2)[1]);
                    break;
                }
            }
            return new MessageProtocol(Optional.of(justContentType), charset, Optional.empty());
        }).orElse(new MessageProtocol());
    }
119493
public static void checkContentResourceType(NodeType contentNodeType) throws NoSuchNodeTypeException
   {
      if (!contentNodeType.isNodeType(WebDavConst.NodeTypes.NT_RESOURCE))
      {
         throw new NoSuchNodeTypeException("Content-Node type " + contentNodeType.getName()
            + " must extend nt:resource.");
      }
   }
1241291
static boolean isText(String contentType) {
        return contentType.contains("text") || contentType.contains("json")
                || contentType.contains("xml") || contentType.contains("html");
    }