What's the correct way to read an inputStream into a node property in JCR 2?
Posted
by Stuart
on Stack Overflow
See other posts from Stack Overflow
or by Stuart
Published on 2010-04-02T20:36:39Z
Indexed on
2010/04/02
20:43 UTC
Read the original article
Hit count: 447
In JCR 1 you could do:
final InputStream in = zip.getInputStream(zip.getEntry(zipEntryName));
node.setProperty(JcrConstants.JCR_CONTENT, in);
But that's deprecated in JCR 2 as detailed at http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html#setProperty%28java.lang.String,%20java.io.InputStream%29
That says I should be using node.setProperty(String, Binary)
but I don't see any way to turn my inputStream into a Binary. Can anyone point me to docs or example code for this?
© Stack Overflow or respective owner