Top Description Fields Constructors Methods
org.junit.jupiter.api.extension

public final Class MediaType

extends MediaType
Class Inheritance
Annotations
@Deprecated
since:5.14
forRemoval:true
@API
status:DEPRECATED
since:5.14
Static Imports
java.nio.charset.StandardCharsets.UTF_8, org.apiguardian.api.API.Status.DEPRECATED

Deprecated

for removal since 5.14.

Use org.junit.jupiter.api.MediaType instead.

Represents a media type as defined by RFC 2045.
Since
5.12
See Also
org.junit.jupiter.api.TestReporter#publishFile(Path, MediaType), org.junit.jupiter.api.TestReporter#publishFile(String, MediaType, org.junit.jupiter.api.function.ThrowingConsumer), ExtensionContext#publishFile(String, MediaType, org.junit.jupiter.api.function.ThrowingConsumer)

Field Summary

Modifier and TypeField and Description
public static final MediaType
APPLICATION_JSON

Hides org.junit.jupiter.api.MediaType.APPLICATION_JSON.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.
The application/json media type.
public static final MediaType
APPLICATION_JSON_UTF_8

Deprecated since 5.14. Use APPLICATION_JSON instead.
The application/json; charset=UTF-8 media type.
public static final MediaType
APPLICATION_OCTET_STREAM

Hides org.junit.jupiter.api.MediaType.APPLICATION_OCTET_STREAM.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.
The application/octet-stream media type.
public static final MediaType
IMAGE_JPEG

Hides org.junit.jupiter.api.MediaType.IMAGE_JPEG.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.
The image/jpeg media type.
public static final MediaType
IMAGE_PNG

Hides org.junit.jupiter.api.MediaType.IMAGE_PNG.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.
The image/png media type.
public static final MediaType
TEXT_PLAIN

Hides org.junit.jupiter.api.MediaType.TEXT_PLAIN.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.
The text/plain media type.
public static final MediaType
TEXT_PLAIN_UTF_8

Hides org.junit.jupiter.api.MediaType.TEXT_PLAIN_UTF_8.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.
The text/plain; charset=UTF-8 media type.

Constructor Summary

AccessConstructor and Description
private
MediaType(String type, String subtype, @Nullable Charset charset)

private

Method Summary

Modifier and TypeMethod and Description
public static MediaType

Returns:

the media type
create
(String
the type; never null or blank
type
,
String
the subtype; never null or blank
subtype
)

Hides org.junit.jupiter.api.MediaType.create.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

Create a media type with the given type and subtype.

public static MediaType

Returns:

the media type
create
(String
the type; never null or blank
type
,
String
the subtype; never null or blank
subtype
,
Charset
the charset; never null
charset
)

Hides org.junit.jupiter.api.MediaType.create.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

Create a media type with the given type, subtype, and charset.

public static MediaType

Returns:

the parsed media type
parse
(String
the media type value to parse; never null or blank
value
)

Hides org.junit.jupiter.api.MediaType.parse.

References Deprecated MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

Parse the given media type value.

Inherited from org.junit.jupiter.api.MediaType:
equalshashCodetoString

Field Detail

APPLICATION_JSONback to summary
public static final MediaType APPLICATION_JSON

Hides org.junit.jupiter.api.MediaType.APPLICATION_JSON.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The application/json media type.

APPLICATION_JSON_UTF_8back to summary
public static final MediaType APPLICATION_JSON_UTF_8

Deprecated

since 5.14.

Use APPLICATION_JSON instead.

The application/json; charset=UTF-8 media type.

Annotations
@Deprecated
since:5.14
@API
status:DEPRECATED
since:5.14
APPLICATION_OCTET_STREAMback to summary
public static final MediaType APPLICATION_OCTET_STREAM

Hides org.junit.jupiter.api.MediaType.APPLICATION_OCTET_STREAM.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The application/octet-stream media type.

IMAGE_JPEGback to summary
public static final MediaType IMAGE_JPEG

Hides org.junit.jupiter.api.MediaType.IMAGE_JPEG.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The image/jpeg media type.

IMAGE_PNGback to summary
public static final MediaType IMAGE_PNG

Hides org.junit.jupiter.api.MediaType.IMAGE_PNG.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The image/png media type.

TEXT_PLAINback to summary
public static final MediaType TEXT_PLAIN

Hides org.junit.jupiter.api.MediaType.TEXT_PLAIN.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The text/plain media type.

TEXT_PLAIN_UTF_8back to summary
public static final MediaType TEXT_PLAIN_UTF_8

Hides org.junit.jupiter.api.MediaType.TEXT_PLAIN_UTF_8.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The text/plain; charset=UTF-8 media type.

Constructor Detail

MediaTypeback to summary
private MediaType(String type, String subtype, @Nullable Charset charset)
MediaTypeback to summary
private MediaType(String value)

Method Detail

createback to summary
public static MediaType create(String type, String subtype)

Hides org.junit.jupiter.api.MediaType.create.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Create a media type with the given type and subtype.

Parameters
type:String

the type; never null or blank

subtype:String

the subtype; never null or blank

Returns:MediaType

the media type

createback to summary
public static MediaType create(String type, String subtype, Charset charset)

Hides org.junit.jupiter.api.MediaType.create.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Create a media type with the given type, subtype, and charset.

Parameters
type:String

the type; never null or blank

subtype:String

the subtype; never null or blank

charset:Charset

the charset; never null

Returns:MediaType

the media type

parseback to summary
public static MediaType parse(String value)

Hides org.junit.jupiter.api.MediaType.parse.

References Deprecated

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Parse the given media type value.

Must be valid according to RFC 2045.

Parameters
value:String

the media type value to parse; never null or blank

Returns:MediaType

the parsed media type

Exceptions
PreconditionViolationException:
if the value is not a valid media type