Class MAttachmentEntry

java.lang.Object
org.compiere.model.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 Details

    • log

      protected CLogger log
      Logger
  • Constructor Details

    • 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 loading of content
      Parameters:
      name -
      index -
      ds - lazy data source
    • MAttachmentEntry

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

    • getData

      public byte[] getData()
      Returns:
      byte[] content
    • setData

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

      public String getName()
      Returns:
      name of entry
    • setName

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

      public int getIndex()
      Get entry Index
      Returns:
      entry index
    • toString

      public String toString()
      To String
      Overrides:
      toString in class Object
      Returns:
      name
    • toStringX

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

      public void dump()
      Dump Data to standard out
    • 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 an image
      Returns:
      true if *.gif, *.jpg or *.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)
      Set entry index
      Parameters:
      index -
    • setLazyDataSource

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

      public IAttachmentLazyDataSource getLazyDataSource()
      Get the lazy data source
      Returns:
    • setUpdated

      public void setUpdated(boolean updated)
      Set the updated property
      Parameters:
      updated -
    • isUpdated

      public boolean isUpdated()
      Get the updated property
      Returns:
      true if updated