Package org.compiere.model
Class MAttachmentEntry
java.lang.Object
org.compiere.model.MAttachmentEntry
Individual Attachment Entry of MAttachment
- Version:
- $Id: MAttachmentEntry.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $
- Author:
- Jorg Janke
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMAttachmentEntry
(String name, byte[] data) Attachment EntryMAttachmentEntry
(String name, byte[] data, int index) Attachment EntryMAttachmentEntry
(String name, int index, IAttachmentLazyDataSource ds) Constructor for delayed loading of contentCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
dump()
Dump Data to standard outGet Content (Mime) Typebyte[]
getData()
getFile()
Get File with default nameGet FileGet File with nameint
getIndex()
Get entry IndexGet Data as Input StreamGet the lazy data sourcegetName()
boolean
Is attachment entry an imageboolean
isPDF()
Is attachment entry a PDFboolean
Get the updated propertyvoid
setData
(byte[] data) void
setIndex
(int index) Set entry indexvoid
Set the lazy data sourcevoid
void
setUpdated
(boolean updated) Set the updated propertytoString()
To StringTo String Extended
-
Field Details
-
log
Logger
-
-
Constructor Details
-
MAttachmentEntry
Attachment Entry- Parameters:
name
- namedata
- binary dataindex
- optional index
-
MAttachmentEntry
Attachment Entry- Parameters:
name
- namedata
- binary data
-
MAttachmentEntry
Constructor for delayed loading of content- Parameters:
name
-index
-ds
- lazy data source
-
MAttachmentEntry
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
- Returns:
- name of entry
-
setName
- Parameters:
name
- The name to set.
-
getIndex
public int getIndex()Get entry Index- Returns:
- entry index
-
toString
To String -
toStringX
To String Extended- Returns:
- name (length)
-
dump
public void dump()Dump Data to standard out -
getFile
Get File with default name- Returns:
- File
-
getFile
Get File with name- Parameters:
fileName
- optional file name- Returns:
- file
-
getFile
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
Get Content (Mime) Type- Returns:
- content type
-
getInputStream
Get Data as Input Stream- Returns:
- input stream
-
setIndex
public void setIndex(int index) Set entry index- Parameters:
index
-
-
setLazyDataSource
Set the lazy data source- Parameters:
ds
-
-
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
-