I need to write large files in Jackrabbit repository. To avoid memory problems I want to send data from client in small byte arrays, and stateful-bean will write them to repository in some kind of stream.
P.S. Sorry for poor english.
In JCR 2.0 you create a binary property via the
Node.setProperty(java.lang.String name,Binary value)
method, and Binary has a getInputStream() method that you can use to supply the content stream.
This means that you should be able to stream directly from the client to the repository, if the repository implementation supports streaming and if you setup the whole chain correctly. I assume Apache Jackrabbit does support streaming in such a scenario but you might need to check that depending on which version you use.
I don't think JCR supports appending streams to existing Properties, so if you absolutely need to send data from the client across several requests, you'll need to keep a long-lived JCR Session around across multiple client requests, and feed the Binary's stream from the data that you get from the client, in small chunks. This looks more complicated than direct streaming, but should work as well.