Class ContentType


  • public final class ContentType
    extends Object
    This class represents a MIME ContentType value. It provides methods to parse a ContentType string into individual components and to generate a MIME style ContentType string.
    Version:
    1.7, 02/03/27
    Author:
    John Mani
    • Constructor Detail

      • ContentType

        public ContentType​(String s)
                    throws jakarta.xml.ws.WebServiceException
        Constructor that takes a Content-Type string. The String is parsed into its constituents: primaryType, subType and parameters. A ParseException is thrown if the parse fails.
        Parameters:
        s - the Content-Type string.
        Throws:
        jakarta.xml.ws.WebServiceException - if the parse fails.
    • Method Detail

      • getPrimaryType

        public String getPrimaryType()
        Return the primary type.
        Returns:
        the primary type
      • getSubType

        public String getSubType()
        Return the subType.
        Returns:
        the subType
      • getBaseType

        public String getBaseType()
        Return the MIME type string, without the parameters. The returned value is basically the concatenation of the primaryType, the '/' character and the secondaryType.
        Returns:
        the type
      • getParameter

        public String getParameter​(String name)
        Return the specified parameter value. Returns null if this parameter is absent.
        Parameters:
        name - parameter name
        Returns:
        parameter value
      • getParameterList

        public com.sun.xml.ws.encoding.ParameterList getParameterList()
        Return a ParameterList object that holds all the available parameters. Returns null if no parameters are available.
        Returns:
        ParameterList