I am using Jackrabbit 2.8.0 and JCR 2.0, I am developing a project for a organization so that it's users can store their documents and directories in digital format using their user account. I want to give size quota limit to all users. For keeping track of size, I am trying to get size of any JCR Node including its child nodes. Any kind of help would be highly appreciable. Thanks in advance
//jcr session after login to repository with user credentials
Session jcrsession = sessions.getSession();
Node root = jcrsession.getRootNode();
//added a file type node to root
file = root.addNode(fileName, Config.EDMS_DOCUMENT);
file.setProperty(Config.EDMS_SIZE, filesize);
InputStream isss= new ByteArrayInputStream(decodedBaseData);
Binary myBinary = valueFactory.createBinary(isss);
file.addMixin("mix:referenceable");
//added a node which will contain binary file
Node resNode = file.addNode(Config.EDMS_CONTENT,"edms:resource");
try {
//added binary data to node
resNode.setProperty("jcr:data",myBinary);
} catch (IOException e) {
e.printStackTrace();
}finally{
myBinary.dispose();
isss.close();
}
jcrsession.save();
this is how I add document type nodes and now I want to get size (in KB) of a node which may have several child nodes either of folder type or file type.