]> git.argeo.org Git - lgpl/argeo-commons.git/blob - sandbox/runtime/org.argeo.sandbox.jackrabbit/src/main/java/FirstHop.java
Branding settings / Moved logo to RIA Core
[lgpl/argeo-commons.git] / sandbox / runtime / org.argeo.sandbox.jackrabbit / src / main / java / FirstHop.java
1 import javax.jcr.Repository;
2 import javax.jcr.Session;
3 import org.apache.jackrabbit.core.TransientRepository;
4
5 /**
6 * First hop example. Logs in to a content repository and prints a
7 * status message.
8 */
9 public class FirstHop {
10
11 /**
12 * The main entry point of the example application.
13 *
14 * @param args command line arguments (ignored)
15 * @throws Exception if an error occurs
16 */
17 public static void main(String[] args) throws Exception {
18 Repository repository = new TransientRepository();
19 Session session = repository.login();
20 try {
21 String user = session.getUserID();
22 String name = repository.getDescriptor(Repository.REP_NAME_DESC);
23 System.out.println(
24 "Logged in as " + user + " to a " + name + " repository.");
25 } finally {
26 session.logout();
27 }
28 }
29
30 }