Class AttachmentDataSource
java.lang.Object
com.day.cq.wcm.foundation.forms.attachments.AttachmentDataSource
- All Implemented Interfaces:
FileDataSource,javax.activation.DataSource
Implementation of
FileDataSource.-
Constructor Summary
ConstructorsConstructorDescriptionAttachmentDataSource(RequestParameter fileRequestParameter) Constructor ofAttachmentDataSource. -
Method Summary
-
Constructor Details
-
AttachmentDataSource
Constructor ofAttachmentDataSource.- Parameters:
fileRequestParameter- The file request parameter
-
-
Method Details
-
getContentType
- Specified by:
getContentTypein interfacejavax.activation.DataSource- Returns:
- content media type.
-
getType
Description copied from interface:FileDataSourceReturns the MIME type of the content.- Specified by:
getTypein interfaceFileDataSource- Returns:
- content MIME type.
-
getTypeFromFileName
Description copied from interface:FileDataSourceReturns the MIME type extension from file name.- Specified by:
getTypeFromFileNamein interfaceFileDataSource- Returns:
- content MIME type extension from file Name.
-
getSize
public long getSize()Description copied from interface:FileDataSourceReturns the size of the file in bytes.- Specified by:
getSizein interfaceFileDataSource- Returns:
- size of attachment in bytes.
-
getInputStream
- Specified by:
getInputStreamin interfacejavax.activation.DataSource- Returns:
- request parameter input stream.
- Throws:
IOException- if I/O error occurs.
-
getName
- Specified by:
getNamein interfacejavax.activation.DataSource- Returns:
- request parameter file name.
-
getOutputStream
- Specified by:
getOutputStreamin interfacejavax.activation.DataSource- Returns:
- request parameter output stream.
- Throws:
IOException- if I/O error occurs.
-