Class SerialisableAttachmentDataSource

  • All Implemented Interfaces:
    javax.activation.DataSource

    public class SerialisableAttachmentDataSource
    extends Object
    implements javax.activation.DataSource
    This class wraps a SerialisableAttachment in a DataSource to allow for easily attaching to messages created with Commons Mail. Name, content and content type will be taken over, getOutputStream() will not work since writing to an attachment does not make sense – at least at the time this data source is being used.
    • Constructor Detail

      • SerialisableAttachmentDataSource

        public SerialisableAttachmentDataSource​(SerialisableAttachment att)
        Creates a new wrapper for a SerialisableAttachment.
        Parameters:
        att - The wrapped serialisable attachment.
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in interface javax.activation.DataSource
      • getContentType

        public String getContentType()
        Specified by:
        getContentType in interface javax.activation.DataSource
      • getInputStream

        public InputStream getInputStream()
                                   throws IOException
        Specified by:
        getInputStream in interface javax.activation.DataSource
        Throws:
        IOException