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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In JCR 2.0 you create a binary property via the
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.