Class AttachmentDataSource

  • All Implemented Interfaces:
    FileDataSource, javax.activation.DataSource

    public class AttachmentDataSource
    extends java.lang.Object
    implements FileDataSource
    Implementation of FileDataSource.
    • Constructor Detail

      • AttachmentDataSource

        public AttachmentDataSource​(RequestParameter fileRequestParameter)
        Constructor of AttachmentDataSource.
        Parameters:
        fileRequestParameter - The file request parameter
    • Method Detail

      • getContentType

        public java.lang.String getContentType()
        Specified by:
        getContentType in interface javax.activation.DataSource
        Returns:
        content media type.
      • getType

        public java.lang.String getType()
        Description copied from interface: FileDataSource
        Returns the MIME type of the content.
        Specified by:
        getType in interface FileDataSource
        Returns:
        content MIME type.
      • getTypeFromFileName

        public java.lang.String getTypeFromFileName()
        Description copied from interface: FileDataSource
        Returns the MIME type extension from file name.
        Specified by:
        getTypeFromFileName in interface FileDataSource
        Returns:
        content MIME type extension from file Name.
      • getSize

        public long getSize()
        Description copied from interface: FileDataSource
        Returns the size of the file in bytes.
        Specified by:
        getSize in interface FileDataSource
        Returns:
        size of attachment in bytes.
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Specified by:
        getInputStream in interface javax.activation.DataSource
        Returns:
        request parameter input stream.
        Throws:
        java.io.IOException - if I/O error occurs.
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface javax.activation.DataSource
        Returns:
        request parameter file name.
      • getOutputStream

        public java.io.OutputStream getOutputStream()
                                             throws java.io.IOException
        Specified by:
        getOutputStream in interface javax.activation.DataSource
        Returns:
        request parameter output stream.
        Throws:
        java.io.IOException - if I/O error occurs.