Package org.compiere.model
Class AttachmentDBLazyDataSource
java.lang.Object
org.compiere.model.AttachmentDBLazyDataSource
- All Implemented Interfaces:
IAttachmentLazyDataSource
Lazy loading data source for
AttachmentDBLOB
-
Constructor Summary
ConstructorsConstructorDescriptionAttachmentDBLazyDataSource
(int AD_Attachment_ID, int index, String fileName, String sizeValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterDelete
(int deletedIndex) void
cleanUp()
Clean up resources heldbyte[]
getData()
Return a byte array containing the data from the Attachment Entry Usually the implementing class must have a constructor with the variable(s) required for loading later the datagetFile()
Get file attachmentGet input stream for attachment entrylong
getSize()
Get size of attachment entry
-
Constructor Details
-
AttachmentDBLazyDataSource
public AttachmentDBLazyDataSource(int AD_Attachment_ID, int index, String fileName, String sizeValue) - Parameters:
AD_Attachment_ID
- attachment record idindex
- attachment entry index (start from 0)fileName
- attachment entry file namesizeValue
- attachment entry uncompress size
-
-
Method Details
-
getData
public byte[] getData()Description copied from interface:IAttachmentLazyDataSource
Return a byte array containing the data from the Attachment Entry Usually the implementing class must have a constructor with the variable(s) required for loading later the data- Specified by:
getData
in interfaceIAttachmentLazyDataSource
- Returns:
- byte[] attachment content
-
getInputStream
Description copied from interface:IAttachmentLazyDataSource
Get input stream for attachment entry- Specified by:
getInputStream
in interfaceIAttachmentLazyDataSource
- Returns:
- input stream
-
getFile
Description copied from interface:IAttachmentLazyDataSource
Get file attachment- Specified by:
getFile
in interfaceIAttachmentLazyDataSource
- Returns:
- file attachment or null
-
cleanUp
public void cleanUp()Description copied from interface:IAttachmentLazyDataSource
Clean up resources held- Specified by:
cleanUp
in interfaceIAttachmentLazyDataSource
-
getSize
public long getSize()Description copied from interface:IAttachmentLazyDataSource
Get size of attachment entry- Specified by:
getSize
in interfaceIAttachmentLazyDataSource
- Returns:
- size
-
afterDelete
protected void afterDelete(int deletedIndex)
-