@Eduard, regarding third-party dependencies - are you doing this as an exercise in college / university or something that will affect real users in a production environment?
runs the risk of appearing very pretentious; do not redefine the wheel! I would surely have a 2nd call to use JCR, so you are dependent on the standard and not on a third-party implementation.
JCR - ( , (.. )). JCR - API, ( ).
, , , 99 - 110% JCR. , , , , .
bmscomp, JackRabbit http://jackrabbit.apache.org/