Module jakarta.mail

Class MimeBodyPart.EncodedFileDataSource

  • All Implemented Interfaces:
    jakarta.activation.DataSource, EncodingAware
    Enclosing class:
    MimeBodyPart

    private static class MimeBodyPart.EncodedFileDataSource
    extends jakarta.activation.FileDataSource
    implements EncodingAware
    A FileDataSource class that allows us to specify the Content-Type and Content-Transfer-Encoding.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String contentType  
      private java.lang.String encoding  
    • Constructor Summary

      Constructors 
      Constructor Description
      EncodedFileDataSource​(java.io.File file, java.lang.String contentType, java.lang.String encoding)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()  
      java.lang.String getEncoding()
      Return the MIME Content-Transfer-Encoding to use for this data, or null to indicate that an appropriate value should be chosen by the caller.
      • Methods inherited from class jakarta.activation.FileDataSource

        getFile, getInputStream, getName, getOutputStream, setFileTypeMap
      • Methods inherited from class java.lang.Object

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

      • contentType

        private java.lang.String contentType
      • encoding

        private java.lang.String encoding
    • Constructor Detail

      • EncodedFileDataSource

        public EncodedFileDataSource​(java.io.File file,
                                     java.lang.String contentType,
                                     java.lang.String encoding)
    • Method Detail

      • getContentType

        public java.lang.String getContentType()
        Specified by:
        getContentType in interface jakarta.activation.DataSource
        Overrides:
        getContentType in class jakarta.activation.FileDataSource
      • getEncoding

        public java.lang.String getEncoding()
        Description copied from interface: EncodingAware
        Return the MIME Content-Transfer-Encoding to use for this data, or null to indicate that an appropriate value should be chosen by the caller.
        Specified by:
        getEncoding in interface EncodingAware
        Returns:
        the Content-Transfer-Encoding value, or null