Class ContentType

java.lang.Object
com.sun.xml.ws.encoding.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 Details

    • 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 Details

    • 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