Class AbstractContentBody

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.hc.core5.http.ContentType contentType  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractContentBody​(org.apache.hc.core5.http.ContentType contentType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getCharset()
      The body descriptors character set, defaulted appropriately for the MIME type.
      org.apache.hc.core5.http.ContentType getContentType()  
      java.lang.String getMediaType()
      Gets the defaulted MIME media type for this content.
      java.lang.String getMimeType()
      Returns the body descriptors MIME type.
      java.lang.String getSubType()
      Gets the defaulted MIME sub type for this content.
      • Methods inherited from class java.lang.Object

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

      • contentType

        private final org.apache.hc.core5.http.ContentType contentType
    • Constructor Detail

      • AbstractContentBody

        public AbstractContentBody​(org.apache.hc.core5.http.ContentType contentType)
        Since:
        4.3
    • Method Detail

      • getContentType

        public org.apache.hc.core5.http.ContentType getContentType()
        Since:
        4.3
      • getMediaType

        public java.lang.String getMediaType()
        Description copied from interface: ContentDescriptor
        Gets the defaulted MIME media type for this content. For example TEXT, IMAGE, MULTIPART
        Specified by:
        getMediaType in interface ContentDescriptor
        Returns:
        the MIME media type when content-type specified, otherwise the correct default (TEXT)
        See Also:
        ContentDescriptor.getMimeType()
      • getCharset

        public java.lang.String getCharset()
        Description copied from interface: ContentDescriptor

        The body descriptors character set, defaulted appropriately for the MIME type.

        For TEXT types, this will be defaulted to us-ascii. For other types, when the charset parameter is missing this property will be null.

        Specified by:
        getCharset in interface ContentDescriptor
        Returns:
        Character set, which has been parsed from the content-type definition. Not null for TEXT types, when unset will be set to default us-ascii. For other types, when unset, null will be returned.