public class SimpleRepositoryFileDataTransformer extends Object implements ITransformer<org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData>
ITransformer
that can read and write nt:resource
nodes.Constructor and Description |
---|
SimpleRepositoryFileDataTransformer() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead(String contentType,
Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
Returns
true if this transformer can read data for files with the given content type and return the
data in the given form. |
boolean |
canWrite(Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
Returns
true if this transformer can write data of the form clazz . |
void |
createContentNode(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData data,
javax.jcr.Node fileNode)
Creates a JCR node subtree representing the given
content . |
org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData |
fromContentNode(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
javax.jcr.Node fileNode)
Transforms a JCR node subtree into an
IRepositoryFileData . |
String |
getContentType()
Returns the content type string for this transformer.
|
void |
updateContentNode(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData data,
javax.jcr.Node fileNode)
Updates a JCR node subtree representing the given
content . |
public boolean canRead(String contentType, Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
true
if this transformer can read data for files with the given content type and return the
data in the given form.canRead
in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData>
contentType
- content type to checkclazz
- class to checktrue
if this transformer can read data for files with the given content type and return the
data in the given formpublic boolean canWrite(Class<? extends org.pentaho.platform.api.repository2.unified.IRepositoryFileData> clazz)
true
if this transformer can write data of the form clazz
.canWrite
in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData>
clazz
- class to checktrue
if this transformer can write data of the form clazz
public String getContentType()
getContentType
in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData>
public void createContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData data, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
content
.createContentNode
in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData>
session
- JCR sessionpentahoJcrConstants
- constantsdata
- data to createfileNode
- node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFilejavax.jcr.RepositoryException
- if anything goes wrongpublic org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData fromContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
IRepositoryFileData
.fromContentNode
in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData>
session
- JCR sessionpentahoJcrConstants
- constantsfileNode
- node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFileIRepositoryFileData
instancejavax.jcr.RepositoryException
- if anything goes wrongpublic void updateContentNode(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData data, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
content
.updateContentNode
in interface ITransformer<org.pentaho.platform.api.repository2.unified.data.simple.SimpleRepositoryFileData>
session
- JCR sessionpentahoJcrConstants
- constantsdata
- data to updatefileNode
- node of type pho_nt:pentahoFile or pho_nt:pentahoLinkedFilejavax.jcr.RepositoryException
- if anything goes wrongCopyright © 2019 Hitachi Vantara. All rights reserved.