public enum MediaTypes extends Enum<MediaTypes>
Enum Constant and Description |
---|
ANY |
DETECT
(Only for produces) Attempts to detect the MimeType as well as charset when not known
|
JSON |
MULTIPART |
MULTIPART_FORMDATA |
MULTIPART_RELATED |
OCTET |
PDF |
TEXT |
XML |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(String acceptHeader)
Checks if this enum matches a value in the provided 'Accept' header.
|
static MediaTypes |
fromValue(String contentType) |
Charset |
getDefaultCharset()
returns the default charset for the given mediatype or null when non is allowed
|
org.springframework.util.MimeType |
getMimeType()
Returns the MimeType without any parameters (such as charset)
|
org.springframework.util.MimeType |
getMimeType(String charset) |
boolean |
includes(String contentTypeHeader)
Matches the provided 'Content-Type' to this enum, should always be valid, is not weighted
|
static MediaTypes |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MediaTypes[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MediaTypes ANY
public static final MediaTypes DETECT
public static final MediaTypes TEXT
public static final MediaTypes XML
public static final MediaTypes JSON
public static final MediaTypes PDF
public static final MediaTypes OCTET
public static final MediaTypes MULTIPART_RELATED
public static final MediaTypes MULTIPART_FORMDATA
public static final MediaTypes MULTIPART
public static MediaTypes[] values()
for (MediaTypes c : MediaTypes.values()) System.out.println(c);
public static MediaTypes valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Charset getDefaultCharset()
public boolean includes(@Nullable String contentTypeHeader)
public boolean accepts(@Nullable String acceptHeader)
public static MediaTypes fromValue(String contentType)
public org.springframework.util.MimeType getMimeType()
public org.springframework.util.MimeType getMimeType(String charset)
Copyright © 2023 Frank!Framework. All rights reserved.