Package org.opencms.mail
Class CmsVfsDataSource
java.lang.Object
org.opencms.mail.CmsVfsDataSource
- All Implemented Interfaces:
javax.activation.DataSource
DataSource wrapper for VFS resources, allows easy sending of VFS resources as email attachments.
- Since:
- 6.2.0
-
Constructor Summary
ConstructorDescriptionCmsVfsDataSource
(CmsObject cms, CmsResource resource) Creates a new data source for the given VFS resource. -
Method Summary
Modifier and TypeMethodDescriptionReturns an input stream baded on the file contents.getName()
Returns the root path of the given resource.Don't use this method, VFS resources can't be written using this datasource class.
-
Constructor Details
-
CmsVfsDataSource
Creates a new data source for the given VFS resource.- Parameters:
cms
- the current users OpenCms contextresource
- the resource to use- Throws:
CmsException
- in case of errors accessing the resource in the VFS
-
-
Method Details
-
getContentType
- Specified by:
getContentType
in interfacejavax.activation.DataSource
- See Also:
-
DataSource.getContentType()
-
getInputStream
Returns an input stream baded on the file contents.- Specified by:
getInputStream
in interfacejavax.activation.DataSource
- See Also:
-
DataSource.getInputStream()
-
getName
Returns the root path of the given resource.- Specified by:
getName
in interfacejavax.activation.DataSource
- See Also:
-
DataSource.getName()
-
getOutputStream
Don't use this method, VFS resources can't be written using this datasource class.This method will just return a new
.ByteArrayOutputStream
- Specified by:
getOutputStream
in interfacejavax.activation.DataSource
- See Also:
-
DataSource.getOutputStream()
-