Package io.muserver
Class MediaTypeParser
- java.lang.Object
-
- io.muserver.MediaTypeParser
-
public class MediaTypeParser extends java.lang.Object
A utility class to parse Media Type or Content Type values such astext/plain
andtext/plain; charset=UTF-8
etc
-
-
Constructor Summary
Constructors Constructor Description MediaTypeParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.ws.rs.core.MediaType
fromString(java.lang.String value)
Converts a string such as "text/plain" into a MediaType object.static java.lang.String
toString(javax.ws.rs.core.MediaType mediaType)
Converts a MediaType object into a string, suitable for printing in an HTTP header.
-
-
-
Method Detail
-
fromString
public static javax.ws.rs.core.MediaType fromString(java.lang.String value)
Converts a string such as "text/plain" into a MediaType object.- Parameters:
value
- The value to parse- Returns:
- A MediaType object
-
toString
public static java.lang.String toString(javax.ws.rs.core.MediaType mediaType)
Converts a MediaType object into a string, suitable for printing in an HTTP header.- Parameters:
mediaType
- The type to print- Returns:
- A String, such as "image/jpeg"
-
-