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 voidafterDelete(int deletedIndex) voidcleanUp()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 entrylonggetSize()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:IAttachmentLazyDataSourceReturn 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:
getDatain interfaceIAttachmentLazyDataSource- Returns:
- byte[] attachment content
-
getInputStream
Description copied from interface:IAttachmentLazyDataSourceGet input stream for attachment entry- Specified by:
getInputStreamin interfaceIAttachmentLazyDataSource- Returns:
- input stream
-
getFile
Description copied from interface:IAttachmentLazyDataSourceGet file attachment- Specified by:
getFilein interfaceIAttachmentLazyDataSource- Returns:
- file attachment or null
-
cleanUp
public void cleanUp()Description copied from interface:IAttachmentLazyDataSourceClean up resources held- Specified by:
cleanUpin interfaceIAttachmentLazyDataSource
-
getSize
public long getSize()Description copied from interface:IAttachmentLazyDataSourceGet size of attachment entry- Specified by:
getSizein interfaceIAttachmentLazyDataSource- Returns:
- size
-
afterDelete
protected void afterDelete(int deletedIndex)
-