Adempiere 3.5.2a

org.compiere.model
Class MAttachmentEntry

java.lang.Object
  extended by 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 Summary
protected  CLogger log
          Logger
 
Constructor Summary
MAttachmentEntry(String name, byte[] data)
          Attachment Entry
MAttachmentEntry(String name, byte[] data, int index)
          Attachment Entry
 
Method Summary
 void dump()
          Dump Data
 String getContentType()
          Get Content (Mime) Type
 byte[] getData()
           
 File getFile()
          Get File with default name
 File getFile(File file)
          Get File
 File getFile(String fileName)
          Get File with name
 int getIndex()
          Get Attachment Index
 InputStream getInputStream()
          Get Data as Input Stream
 String getName()
           
 boolean isGraphic()
          Isattachment entry a Graphic
 boolean isPDF()
          Is attachment entry a PDF
 void setData(byte[] data)
           
 void setName(String name)
           
 String toString()
          To String
 String toStringX()
          To String Extended
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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
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:
timestamp

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


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()
Isattachment 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

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.