Module jakarta.mail

Class MimeBodyPart.EncodedFileDataSource

java.lang.Object
jakarta.activation.FileDataSource
jakarta.mail.internet.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 Details

    • contentType

      private String contentType
    • encoding

      private String encoding
  • Constructor Details

    • EncodedFileDataSource

      public EncodedFileDataSource(File file, String contentType, String encoding)
  • Method Details

    • getContentType

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

      public 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