import java.util.TreeMap;
import java.util.stream.Collectors;
-import org.argeo.api.acr.Content;
import org.argeo.api.acr.ContentResourceException;
import org.argeo.api.acr.CrName;
import org.argeo.api.acr.NamespaceUtils;
import org.argeo.api.acr.spi.ContentProvider;
+import org.argeo.api.acr.spi.ProvidedContent;
import org.argeo.api.acr.spi.ProvidedSession;
/** Access a file system as a {@link ContentProvider}. */
public class FsContentProvider implements ContentProvider {
final static String XMLNS_ = "xmlns:";
+ private final String mountPath;
private final Path rootPath;
private final boolean isRoot;
private NavigableMap<String, String> prefixes = new TreeMap<>();
- public FsContentProvider(Path rootPath, boolean isRoot) {
+ public FsContentProvider(String mountPath, Path rootPath, boolean isRoot) {
+ this.mountPath = mountPath;
this.rootPath = rootPath;
this.isRoot = isRoot;
initNamespaces();
try {
UserDefinedFileAttributeView udfav = Files.getFileAttributeView(rootPath,
UserDefinedFileAttributeView.class);
+ if(udfav==null)
+ return;
for (String name : udfav.list()) {
if (name.startsWith(XMLNS_)) {
ByteBuffer buf = ByteBuffer.allocate(udfav.size(name));
}
}
+
+
+@Override
+ public String getMountPath() {
+ return mountPath;
+ }
boolean isRoot(Path path) {
try {
}
@Override
- public Content get(ProvidedSession session, String mountPath, String relativePath) {
+ public ProvidedContent get(ProvidedSession session, String mountPath, String relativePath) {
return new FsContent(session, this, rootPath.resolve(relativePath));
}