Package io.muserver

Class MediaTypeParser


  • public class MediaTypeParser
    extends java.lang.Object
    A utility class to parse Media Type or Content Type values such as text/plain and text/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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MediaTypeParser

        public MediaTypeParser()
    • 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"