Alexander Klimetschek wrote:
On Fri, Feb 26, 2010 at 15:40, Illarion Kovalchuk
<[email protected]> wrote:
My task is to determine the proper JCR repository structure for storing of
binary data, so that I'll be able to:

1) Read data starting from any offset
2) Write/Modify data starting from any offset

It seems that binary properties can't be used in such way, so I need to
implement some logic on top of jcr... Could you help?

Yes, binary properties can only be read as a whole (InputStream
returned is read-only) and stored back as a whole (new input stream).

I think the way to go is to copy the existing binary value (note: pseudo-code)

node.getProperty("jcr:data").getBinary().getInputStream()

into either a local file or an in-memory input stream, do your work
there and then finally store the whole stream again

node.setProperty("jcr:data", valueFactory.createBinary(stream))

Regards,
Alex

Thanks, but your solution would be acceptable for small amounts of data, but in our project we have to deal with big contents, from hundreds of megabytes to gigabytes, and clients will work remotely via internet, so they just can't get binary content as a whole, modify it and upload again.

Is there some other way?

--
With best regards

Illarion Kovalchuk, COMODO Online Backup.

Reply via email to