]> git.argeo.org Git - lgpl/argeo-commons.git/blob - sandbox/runtime/org.argeo.sandbox.jackrabbit/src/main/java/jcr/ReadData.java
Adapt to version upgrade
[lgpl/argeo-commons.git] / sandbox / runtime / org.argeo.sandbox.jackrabbit / src / main / java / jcr / ReadData.java
1 package jcr;
2
3 import javax.jcr.*;
4 import java.io.IOException;
5
6 public class ReadData extends Base {
7 public ReadData() {
8 }
9
10 public static void main(String[] args) throws IOException, RepositoryException {
11 ReadData readdata = new ReadData();
12 readdata.run();
13 }
14
15 private void run() throws IOException, RepositoryException {
16 Repository repository = getRepository();
17
18 Session session = getSession(repository);
19
20 Node rootnode = session.getRootNode();
21
22 Node childnode = null;
23 try {
24 childnode = rootnode.getNode("foo");
25 try {
26 Property prop = childnode.getProperty("bar");
27 System.out.println("value of /foo@bar: " + prop.getString());
28 } catch (PathNotFoundException pnfe) {
29 System.out.println("/foo@bar not found.");
30 }
31 } catch (PathNotFoundException pnfe) {
32 System.out.println("/foo not found.");
33 }
34
35 logout(session);
36 }
37 }