public class CmsVfsDataSource extends java.lang.Object implements javax.activation.DataSource
Constructor and Description |
---|
CmsVfsDataSource(CmsObject cms,
CmsResource resource)
Creates a new data source for the given VFS resource.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType() |
java.io.InputStream |
getInputStream()
Returns an input stream baded on the file contents.
|
java.lang.String |
getName()
Returns the root path of the given resource.
|
java.io.OutputStream |
getOutputStream()
Don't use this method, VFS resources can't be written using this datasource class.
|
public CmsVfsDataSource(CmsObject cms, CmsResource resource) throws CmsException
cms
- the current users OpenCms contextresource
- the resource to useCmsException
- in case of errors accessing the resource in the VFSpublic java.lang.String getContentType()
getContentType
in interface javax.activation.DataSource
DataSource.getContentType()
public java.io.InputStream getInputStream()
getInputStream
in interface javax.activation.DataSource
DataSource.getInputStream()
public java.lang.String getName()
getName
in interface javax.activation.DataSource
DataSource.getName()
public java.io.OutputStream getOutputStream()
This method will just return a new
.ByteArrayOutputStream
getOutputStream
in interface javax.activation.DataSource
DataSource.getOutputStream()