You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Peri Subrahmanya <pe...@gmail.com> on 2012/02/27 18:30:05 UTC

Removing contents under root

Devs

Any efficient way or getting rid of content under the root?  So before I start my tests, I can start clean. Please advise.

Thanks
-PeriS

Re: Removing contents under root

Posted by David Buchmann <da...@liip.ch>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

NodeIterator i = session.getRootNode().getNodes();
while(i.hasNext()) {i.nextNode().remove();}
PropertyIterator p = session.getRootNode().getProperties();
while(p.hasNext()) {p.nextProperty().remove();}
session.save();



Am 27.02.2012 18:30, schrieb Peri Subrahmanya:
> Devs
> 
> Any efficient way or getting rid of content under the root?  So before I start my tests, I can start clean. Please advise.
> 
> Thanks
> -PeriS

- -- 
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9M0GcACgkQqBnXnqWBgIs6YgCgr0+1l3ILXzmmxlM515qxi6ie
mpIAn2P2QL8z0szkLFuNZmVOQHBpDYEn
=3x0w
-----END PGP SIGNATURE-----