]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms/src/org/argeo/cms/gcr/fs/FsContentSession.java
SLF4J implementation.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / gcr / fs / FsContentSession.java
1 package org.argeo.cms.gcr.fs;
2
3 import java.nio.file.FileSystems;
4 import java.nio.file.Files;
5 import java.nio.file.Path;
6 import java.nio.file.Paths;
7
8 import org.argeo.api.gcr.Content;
9 import org.argeo.api.gcr.ContentSystemProvider;
10 import org.argeo.api.gcr.ContentUtils;
11
12 public class FsContentSession implements ContentSystemProvider {
13 private final Path rootPath;
14
15 public FsContentSession(Path rootPath) {
16 super();
17 this.rootPath = rootPath;
18 }
19
20 @Override
21 public Content get() {
22 return new FsContent(this, rootPath);
23 }
24
25 public static void main(String[] args) {
26 Path path = Paths.get("/home/mbaudier/tmp");
27 System.out.println(FileSystems.getDefault().supportedFileAttributeViews());
28 FsContentSession contentSession = new FsContentSession(path);
29 ContentUtils.traverse(contentSession.get(), (c, d) -> ContentUtils.print(c, System.out, d, true));
30
31 }
32 }