Class MAttachmentEntry


  • public class MAttachmentEntry
    extends Object
    Individual Attachment Entry of MAttachment
    Version:
    $Id: MAttachmentEntry.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $
    Author:
    Jorg Janke
    • Field Detail

      • log

        protected CLogger log
        Logger
    • Constructor Detail

      • MAttachmentEntry

        public MAttachmentEntry​(String name,
                                byte[] data,
                                int index)
        Attachment Entry
        Parameters:
        name - name
        data - binary data
        index - optional index
      • MAttachmentEntry

        public MAttachmentEntry​(String name,
                                byte[] data)
        Attachment Entry
        Parameters:
        name - name
        data - binary data
      • MAttachmentEntry

        public MAttachmentEntry​(String name,
                                int index,
                                IAttachmentLazyDataSource ds)
        Constructor for delayed load
        Parameters:
        name -
        index -
        ds - lazy data source
      • MAttachmentEntry

        public MAttachmentEntry​(MAttachmentEntry copy)
        Copy constructor
        Parameters:
        copy -
    • Method Detail

      • getData

        public byte[] getData()
        Returns:
        Returns the data.
      • setData

        public void setData​(byte[] data)
        Parameters:
        data - The data to set.
      • getName

        public String getName()
        Returns:
        Returns the name.
      • setName

        public void setName​(String name)
        Parameters:
        name - The name to set.
      • getIndex

        public int getIndex()
        Get Attachment Index
        Returns:
        int index
      • toStringX

        public String toStringX()
        To String Extended
        Returns:
        name (length)
      • dump

        public void dump()
        Dump Data
      • getFile

        public File getFile()
        Get File with default name
        Returns:
        File
      • getFile

        public File getFile​(String fileName)
        Get File with name
        Parameters:
        fileName - optional file name
        Returns:
        file
      • getFile

        public File getFile​(File file)
        Get File
        Parameters:
        file - out file
        Returns:
        file
      • isPDF

        public boolean isPDF()
        Is attachment entry a PDF
        Returns:
        true if PDF
      • isGraphic

        public boolean isGraphic()
        Is attachment entry a Graphic
        Returns:
        true if *.gif, *.jpg, *.png
      • getContentType

        public String getContentType()
        Get Content (Mime) Type
        Returns:
        content type
      • getInputStream

        public InputStream getInputStream()
        Get Data as Input Stream
        Returns:
        input stream
      • setIndex

        public void setIndex​(int index)
      • setLazyDataSource

        public void setLazyDataSource​(IAttachmentLazyDataSource ds)
        Set the lazy data source
        Parameters:
        ds -