Class AttachmentDataSource
- java.lang.Object
-
- com.day.cq.wcm.foundation.forms.attachments.AttachmentDataSource
-
- All Implemented Interfaces:
FileDataSource,DataSource
public class AttachmentDataSource extends Object implements FileDataSource
Implementation ofFileDataSource.
-
-
Constructor Summary
Constructors Constructor Description AttachmentDataSource(RequestParameter fileRequestParameter)Constructor ofAttachmentDataSource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContentType()InputStreamgetInputStream()StringgetName()OutputStreamgetOutputStream()longgetSize()Returns the size of the file in bytes.StringgetType()Returns the MIME type of the content.StringgetTypeFromFileName()Returns the MIME type extension from file name.
-
-
-
Constructor Detail
-
AttachmentDataSource
public AttachmentDataSource(RequestParameter fileRequestParameter)
Constructor ofAttachmentDataSource.- Parameters:
fileRequestParameter- The file request parameter
-
-
Method Detail
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfaceDataSource- Returns:
- content media type.
-
getType
public String getType()
Description copied from interface:FileDataSourceReturns the MIME type of the content.- Specified by:
getTypein interfaceFileDataSource- Returns:
- content MIME type.
-
getTypeFromFileName
public String 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
public InputStream getInputStream() throws IOException
- Specified by:
getInputStreamin interfaceDataSource- Returns:
- request parameter input stream.
- Throws:
IOException- if I/O error occurs.
-
getName
public String getName()
- Specified by:
getNamein interfaceDataSource- Returns:
- request parameter file name.
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Specified by:
getOutputStreamin interfaceDataSource- Returns:
- request parameter output stream.
- Throws:
IOException- if I/O error occurs.
-
-