Class MimePartDataSource

    • Field Detail

      • part

        protected MimePart part
        The MimePart that provides the data for this DataSource.
        Since:
        JavaMail 1.4
    • Constructor Detail

      • MimePartDataSource

        public MimePartDataSource​(MimePart part)
        Constructor, that constructs a DataSource from a MimePart.
        Parameters:
        part - the MimePart
    • Method Detail

      • getOutputStream

        public OutputStream getOutputStream()
                                     throws IOException
        DataSource method to return an output stream.

        This implementation throws the UnknownServiceException.

        Specified by:
        getOutputStream in interface DataSource
        Returns:
        an OutputStream
        Throws:
        IOException - for failures creating the OutputStream
      • getContentType

        public String getContentType()
        Returns the content-type of this DataSource.

        This implementation just invokes the getContentType method on the MimePart.

        Specified by:
        getContentType in interface DataSource
        Returns:
        the MIME Type
      • getName

        public String getName()
        DataSource method to return a name.

        This implementation just returns an empty string.

        Specified by:
        getName in interface DataSource
        Returns:
        the name of the object.
      • getMessageContext

        public MessageContext getMessageContext()
        Return the MessageContext for the current part.
        Specified by:
        getMessageContext in interface MessageAware
        Returns:
        the message context
        Since:
        JavaMail 1.1