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 void
dump()
Dump DataString
getContentType()
Get Content (Mime) Typebyte[]
getData()
File
getFile()
Get File with default nameFile
getFile(File file)
Get FileFile
getFile(String fileName)
Get File with nameint
getIndex()
Get Attachment IndexInputStream
getInputStream()
Get Data as Input StreamIAttachmentLazyDataSource
getLazyDataSource()
Get the lazy data sourceString
getName()
boolean
isGraphic()
Is attachment entry a Graphicboolean
isPDF()
Is attachment entry a PDFvoid
setData(byte[] data)
void
setIndex(int index)
void
setLazyDataSource(IAttachmentLazyDataSource ds)
Set the lazy data sourcevoid
setName(String name)
String
toString()
To StringString
toStringX()
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:
-
-