Loads the content type for provided content.

@deprecated Acts as a BC layer for eZ kernel <7.4
325295
private function getContentType(Content $content): EzContentType
    {
        if (method_exists($content, 'getContentType')) {
            return $content->getContentType();
        }

        // @deprecated Remove when support for eZ kernel < 7.4 ends

        return $this->contentTypeService->loadContentType(
            $content->contentInfo->contentTypeId
        );
    }
1306820
public function get_content_type() {
		$headers = wp_remote_retrieve_headers( $this->response );
		if ( ! $headers ) {
			return;
		}

		if ( ! is_object( $headers ) || ! method_exists( $headers, 'offsetGet' ) ) {
			return;
		}

		return $headers->offsetGet( 'content-type' );
	}
375443
def content_type(self) -> ContentType:
        """"""
        if self._ctype:
            return self._ctype
        return (ContentType.config if self.parent.config else
                ContentType.nonconfig)
1217012
@Override
    public String getContentType() {
        String type = this.response.getHeader("Content-Type");
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getContentType: " + type);
        }
        return type;
    }
1251790
def require_content_type(self, content_type):
        """"""
        if self.request.headers.get('content-type', '') != content_type:
            self.halt(400, 'Content type must be ' + content_type)
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);
        }

    }
530996
protected function loadContentTypeId($fieldDefinitionId)
    {
        $dbHandler = $this->getConnection();

        $query = $dbHandler->createSelectQuery();
        $query->select('contentclass_id')
            ->from($dbHandler->quoteTable('ezcontentclass_attribute'))
            ->where(
                $query->expr->eq('id', $fieldDefinitionId)
            );

        $statement = $query->prepare();
        $statement->execute();

        $row = $statement->fetch(\PDO::FETCH_ASSOC);

        if ($row === false) {
            throw new \RuntimeException(
                sprintf(
                    'Content Type ID cannot be retrieved based on the field definition ID "%s"',
                    $fieldDefinitionId
                )
            );
        }

        return $row['contentclass_id'];
    }
219039
public String getContentType() {
        String[] values = getMimeHeader("Content-Type");
        if (values != null && values.length > 0)
            return values[0];
        return null;
    }
1187729
public function loadContent($contentId, Request $request)
    {
        $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);

        $mainLocation = null;
        if (!empty($contentInfo->mainLocationId)) {
            $mainLocation = $this->repository->getLocationService()->loadLocation($contentInfo->mainLocationId);
        }

        $contentType = $this->repository->getContentTypeService()->loadContentType($contentInfo->contentTypeId);

        $contentVersion = null;
        $relations = null;
        if ($this->getMediaType($request) === 'application/vnd.ez.api.content') {
            $languages = Language::ALL;
            if ($request->query->has('languages')) {
                $languages = explode(',', $request->query->get('languages'));
            }

            $contentVersion = $this->repository->getContentService()->loadContent($contentId, $languages);
            $relations = $this->repository->getContentService()->loadRelations($contentVersion->getVersionInfo());
        }

        $restContent = new Values\RestContent(
            $contentInfo,
            $mainLocation,
            $contentVersion,
            $contentType,
            $relations,
            $request->getPathInfo()
        );

        if ($contentInfo->mainLocationId === null) {
            return $restContent;
        }

        return new Values\CachedValue(
            $restContent,
            array('locationId' => $contentInfo->mainLocationId)
        );
    }
1344086
protected function loadContentTypeId($fieldDefinitionId)
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->select($this->connection->quoteIdentifier('contentclass_id'))
            ->from($this->connection->quoteIdentifier('ezcontentclass_attribute'))
            ->where(
                $query->expr()->eq('id', ':fieldDefinitionId')
            )
            ->setParameter(':fieldDefinitionId', $fieldDefinitionId);

        $statement = $query->execute();

        $row = $statement->fetch(\PDO::FETCH_ASSOC);

        if ($row === false) {
            throw new RuntimeException(
                sprintf(
                    'Content Type ID cannot be retrieved based on the field definition ID "%s"',
                    $fieldDefinitionId
                )
            );
        }

        return (int) $row['contentclass_id'];
    }
438981
@Override
    public String getContentType() {
        if (url.getFile().endsWith("!/")) {
            // the type for jar file itself is always "x-java/jar"
            return "x-java/jar";
        }
        String cType = null;
        String entryName = getEntryName();

        if (entryName != null) {
            // if there is an Jar Entry, get the content type from the name
            cType = guessContentTypeFromName(entryName);
        } else {
            try {
                connect();
                cType = jarFileURLConnection.getContentType();
            } catch (IOException ioe) {
                // Ignore
            }
        }
        if (cType == null) {
            cType = "content/unknown";
        }
        return cType;
    }
757880
public String getContentType() {
        final Object contentType = getHeader(HttpMessageHeaders.HTTP_CONTENT_TYPE);

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

        return null;
    }
942205
def content_type(self) -> Optional[ContentTypeHeader]:
        """"""
        try:
            return cast(ContentTypeHeader, self[b'content-type'][0])
        except (KeyError, IndexError):
            return None
244089
@Deprecated
	public void setContent(int[] content)
	{
		if (content == null || content.length == 0)
		{
			throw new NumberFormatException("A Version must contain at least one digit");
		}
		else
		{
			this.version = content;
		}
	}
420750
public String contentMimeType() {
        String ct = contentType();
        if (ct != null) {
            int index = ct.indexOf(";");
            if (index != -1) {
                return ct.substring(0, index);
            } else {
                return ct;
            }
        } else {
            return null;
        }
    }
516718
def get_content_type(name, content):
    
    if hasattr(content, "content_type"):
        content_type = content.content_type
    else:
        mime_type, encoding = mimetypes.guess_type(name)
        content_type = mime_type
    return content_type
896398
def load_model_class(repo, content_type):
    
    schema = get_schema(repo, content_type).to_json()
    return deserialize(schema, module_name=schema['namespace'])