Package org.compiere.model
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
-
-
Constructor Summary
Constructors Constructor Description MAttachmentEntry(String name, byte[] data)Attachment EntryMAttachmentEntry(String name, byte[] data, int index)Attachment EntryMAttachmentEntry(String name, int index, IAttachmentLazyDataSource ds)Constructor for delayed loadMAttachmentEntry(MAttachmentEntry copy)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump()Dump DataStringgetContentType()Get Content (Mime) Typebyte[]getData()FilegetFile()Get File with default nameFilegetFile(File file)Get FileFilegetFile(String fileName)Get File with nameintgetIndex()Get Attachment IndexInputStreamgetInputStream()Get Data as Input StreamIAttachmentLazyDataSourcegetLazyDataSource()Get the lazy data sourceStringgetName()booleanisGraphic()Is attachment entry a GraphicbooleanisPDF()Is attachment entry a PDFvoidsetData(byte[] data)voidsetIndex(int index)voidsetLazyDataSource(IAttachmentLazyDataSource ds)Set the lazy data sourcevoidsetName(String name)StringtoString()To StringStringtoStringX()To String Extended
-
-
-
Field Detail
-
log
protected CLogger log
Logger
-
-
Constructor Detail
-
MAttachmentEntry
public MAttachmentEntry(String name, byte[] data, int index)
Attachment Entry- Parameters:
name- namedata- binary dataindex- optional index
-
MAttachmentEntry
public MAttachmentEntry(String name, byte[] data)
Attachment Entry- Parameters:
name- namedata- 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
-
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-
-
getLazyDataSource
public IAttachmentLazyDataSource getLazyDataSource()
Get the lazy data source- Returns:
-
-