public class ResourceHelper extends Object
hippo:resource
Modifier and Type | Method and Description |
---|---|
static javax.jcr.ValueFactory |
getValueFactory(javax.jcr.Node node)
Gets the
ValueFactory from the Session |
static void |
handlePdfAndSetHippoTextProperty(javax.jcr.Node node,
InputStream inputStream)
Handles the
InputStream and extract text content from the PDF and sets it as a binary type property on the
resource node. |
static void |
setDefaultResourceProperties(javax.jcr.Node node,
String mimeType,
javax.jcr.Binary binary)
Set the default 'hippo:resource' properties:
jcr:mimeType
jcr:data
jcr:lastModified
|
static void |
setDefaultResourceProperties(javax.jcr.Node node,
String mimeType,
javax.jcr.Binary binary,
String filename)
Set the default 'hippo:resource' properties:
jcr:mimeType
jcr:data
jcr:lastModified
hippo:filename
|
static void |
setDefaultResourceProperties(javax.jcr.Node node,
String mimeType,
InputStream inputStream)
Set the default 'hippo:resource' properties:
jcr:mimeType
jcr:data
jcr:lastModified
|
static void |
setDefaultResourceProperties(javax.jcr.Node node,
String mimeType,
InputStream inputStream,
String filename)
Set the default 'hippo:resource' properties:
jcr:mimeType
jcr:data
jcr:lastModified
hippo:filename
|
public static void setDefaultResourceProperties(javax.jcr.Node node, String mimeType, InputStream inputStream) throws javax.jcr.RepositoryException
node
- the Node
on which to set the propertiesmimeType
- the mime-type of the binary data (e.g. application/pdf, image/jpeg)inputStream
- the data stream. Once the properties have been set the input stream will be closed.javax.jcr.RepositoryException
- exception thrown when one of the properties or values could not be setpublic static void setDefaultResourceProperties(javax.jcr.Node node, String mimeType, InputStream inputStream, String filename) throws javax.jcr.RepositoryException
node
- the Node
on which to set the propertiesmimeType
- the mime-type of the binary data (e.g. application/pdf, image/jpeg)inputStream
- the data stream. Once the properties have been set the input stream will be closed.javax.jcr.RepositoryException
- exception thrown when one of the properties or values could not be setpublic static void setDefaultResourceProperties(javax.jcr.Node node, String mimeType, javax.jcr.Binary binary) throws javax.jcr.RepositoryException
node
- the Node
on which to set the propertiesmimeType
- the mime-type of the binary data (e.g. application/pdf, image/jpeg)binary
- the binary data.javax.jcr.RepositoryException
- exception thrown when one of the properties or values could not be setpublic static void setDefaultResourceProperties(javax.jcr.Node node, String mimeType, javax.jcr.Binary binary, String filename) throws javax.jcr.RepositoryException
node
- the Node
on which to set the propertiesmimeType
- the mime-type of the binary data (e.g. application/pdf, image/jpeg)binary
- the binary data.javax.jcr.RepositoryException
- exception thrown when one of the properties or values could not be setpublic static void handlePdfAndSetHippoTextProperty(javax.jcr.Node node, InputStream inputStream)
InputStream
and extract text content from the PDF and sets it as a binary type property on the
resource node. Once the property has been set the input stream will be closed.node
- the Node
on which to set the '"hippo:text"' propertyinputStream
- data streampublic static javax.jcr.ValueFactory getValueFactory(javax.jcr.Node node) throws javax.jcr.RepositoryException
ValueFactory
from the Session
node
- the Node
from which to get the Session
ValueFactory
javax.jcr.RepositoryException
- In case something goes wrong while trying to get the Session
or ValueFactory
Copyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.