Hi Brian,

You would probably want to use the ValueFactory that you can get from your
jcr session to create the binary value from an input stream.

1.
https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#getValueFactory()
2.
https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/ValueFactory.html#createBinary(java.io.InputStream)

Regards,
-Eric

On Wed, Aug 25, 2021 at 4:00 PM Brian E. Lavender <br...@brie.com> wrote:

> How is it I add a binary to a Node?
>
> I see the following method.
> Property setProperty(java.lang.String name, Binary value)
>
> I see that Binary is an interface, yet I am not sure how to create a
> Binary from a File that I open.
>
> Or, stated another way, say I want to add a jpg image from my disk to
> a node. Would I use this setProperty method? How would I do it?
>
> Brian
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
>
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
>

Reply via email to