/* (non-Javadoc)
@see javax.servlet.ServletRequest#getContentType()
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;
    }
324700
public String getContentType() {
        String contentType = getHeader(HttpConstants.Header.CONTENT_TYPE);
        if (contentType == null) {
            contentType = httpServletResponse.getContentType();
        }

        return contentType;
    }
1268218
protected Set<String> getContentTypes(String contentType) {
        if (StringUtils.isNullOrEmpty(contentType)) {
            return Collections.emptySet();
        }

        Set<String> set = new LinkedHashSet<>();
        String[] types = contentType.split(",");
        for (String type : types) {
            if (type.contains(";")) {
                // drop ;q=0.8 quality scores
                type = type.substring(0, type.indexOf(';'));
            }

            set.add(type.trim().toLowerCase());
        }

        return set;
    }
931688
@Override
   public String getContentType()
   {
      try
      {
         if (!connected)
         {
            connect();
         }

         return nodeRepresentation.getMediaType();
      }
      catch (IOException e)
      {
         if (LOG.isTraceEnabled())
         {
            LOG.trace("An exception occurred: " + e.getMessage());
         }
      }
      catch (RepositoryException e)
      {
         if (LOG.isTraceEnabled())
         {
            LOG.trace("An exception occurred: " + e.getMessage());
         }
      }
      return null;
   }
336286
public String getContentType() {
        if (contentType == null)
            contentType = getHeaderField("content-type");
        if (contentType == null) {
            String ct = null;
            try {
                ct = guessContentTypeFromStream(getInputStream());
            } catch(java.io.IOException e) {
            }
            String ce = properties.findValue("content-encoding");
            if (ct == null) {
                ct = properties.findValue("content-type");

                if (ct == null)
                    if (url.getFile().endsWith("/"))
                        ct = "text/html";
                    else
                        ct = guessContentTypeFromName(url.getFile());
            }

            /*
             * If the Mime header had a Content-encoding field and its value
             * was not one of the values that essentially indicate no
             * encoding, we force the content type to be unknown. This will
             * cause a save dialog to be presented to the user.  It is not
             * ideal but is better than what we were previously doing, namely
             * bringing up an image tool for compressed tar files.
             */

            if (ct == null || ce != null &&
                    !(ce.equalsIgnoreCase("7bit")
                      || ce.equalsIgnoreCase("8bit")
                      || ce.equalsIgnoreCase("binary")))
                ct = "content/unknown";
            setContentType(ct);
        }
        return contentType;
    }
219039
public String getContentType() {
        String[] values = getMimeHeader("Content-Type");
        if (values != null && values.length > 0)
            return values[0];
        return null;
    }
439484
public String getResourceType() {
        if (resourceType == null) {
            resourceType = "";
            String type = resource.getResourceType();
            if (StringUtils.isBlank(type) || getPrimaryType().equals(type)) {
                Resource contentResource = getContentResource();
                if (contentResource != null) {
                    type = contentResource.getResourceType();
                    if (StringUtils.isNotBlank(type)) {
                        ResourceHandle handle = ResourceHandle.use(contentResource);
                        if (type.equals(handle.getPrimaryType())) {
                            type = null;
                        }
                    }
                }
            }
            if (StringUtils.isNotBlank(type)) {
                // check for a real existing resource type
                if (!Resource.RESOURCE_TYPE_NON_EXISTING.equals(type)) {
                    resourceType = type;
                }
            }
        }
        return resourceType;
    }
715898
private ContentType getAcceptType() {
        // If the format header is present, it overrides the ACCEPT header.
        String format = m_variableMap.get("format");
        if (format != null) {
            return new ContentType(format);
        }
        String acceptParts = m_request.getHeader(HttpDefs.ACCEPT);
        if (!Utils.isEmpty(acceptParts)) {
	        for (String acceptPart : acceptParts.split(",")) {
	            ContentType acceptType = new ContentType(acceptPart);
	            if (acceptType.isJSON() || acceptType.isXML() || acceptType.isPlainText()) {
	                return acceptType;
	            }
	        }
        }
        return getContentType();
    }
331006
public function getContentType(): string
	{
		if($this->contentType === null)
		{
			$this->contentType = rtrim(strtok((string) $this->headers->get('content-type'), ';'));
		}

		return $this->contentType;
	}
768232
public function getContentTypeService()
    {
        if (null === $this->contentTypeService) {
            $this->contentTypeService = new ContentTypeService(
                $this->client,
                $this->inputDispatcher,
                $this->outputVisitor,
                $this->requestParser
            );
        }

        return $this->contentTypeService;
    }
813910
public Optional<String> toContentTypeHeader() {
        return contentType.map(ct -> {
            if (charset.isPresent()) {
                return ct + "; charset=" + charset.get();
            } else {
                return ct;
            }
        });
    }
620297
@Override
	protected String getContentType(String filePath, HttpServletRequest request) {
		String requestUri = request.getRequestURI();

		// Retrieve the extension
		String extension = getExtension(filePath);
		if (extension == null) {

			LOGGER.info("No extension found for the request URI : " + requestUri);
			return null;
		}

		String binContentType = (String) binaryMimeTypeMap.get(extension);
		if (binContentType == null) {

			LOGGER.info(
					"No binary extension match the extension '" + extension + "' for the request URI : " + requestUri);
			return null;
		}
		return binContentType;
	}
1070390
public <T extends Serializable> T getContentFromType() throws FoxHttpResponseException {
        try {
            return getContent((Class<T>) Class.forName(this.type), false);
        } catch (FoxHttpResponseException e) {
            throw e;
        } catch (Exception e) {
            throw new FoxHttpResponseException(e);
        }

    }
801869
public static function getContentType() {
    if(null === self::$contentType) {
      self::$contentType = @trim($_SERVER['HTTP_CONTENT_TYPE']);
      if(!self::$contentType) {
        self::$contentType = @trim($_SERVER['CONTENT_TYPE']);
        if(!self::$contentType) {
          self::$contentType = false;
        }
      }
    }
    return self::$contentType;
  }
878720
public ContentType getContentType() {
        String contentType = m_headers.get(HttpDefs.CONTENT_TYPE);
        if (contentType == null) {
            return null;
        }
        return new ContentType(contentType);
    }
757880
public String getContentType() {
        final Object contentType = getHeader(HttpMessageHeaders.HTTP_CONTENT_TYPE);

        if (contentType != null) {
            return contentType.toString();
        }

        return null;
    }
695102
private String contentType(ResponseWrapper responseWrapper) {
        return StringUtil.isEmpty(responseWrapper.getHttpContentType()) ? Config.getContentType() : responseWrapper.getHttpContentType();
    }