+ public static void main(String... args) {
+ Path homePath = Paths.get(System.getProperty("user.home"));
+ String username = System.getProperty("user.name");
+ X500Principal principal = new X500Principal(LdapAttrs.uid + "=" + username + ",dc=localhost");
+ Subject subject = new Subject();
+ subject.getPrincipals().add(principal);
+
+ SingleUserContentRepository contentRepository = new SingleUserContentRepository(subject);
+ contentRepository.start();
+ FsContentProvider homeContentProvider = new FsContentProvider("/home", homePath);
+ contentRepository.addProvider(homeContentProvider);
+ Runtime.getRuntime().addShutdownHook(new Thread(() -> contentRepository.stop(), "Shutdown content repository"));
+
+ ContentSession contentSession = contentRepository.get();
+ ContentUtils.traverse(contentSession.get("/"), (c, depth) -> ContentUtils.print(c, System.out, depth, false),
+ 2);
+
+ }