]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.jcr/src/org/argeo/jcr/fs/JcrFileSystemProvider.java
Introduce multi-commands command line utilities.
[lgpl/argeo-commons.git] / org.argeo.jcr / src / org / argeo / jcr / fs / JcrFileSystemProvider.java
index 04d1342bf3f480708f707805327487fb8f805b0e..7dbd4e43f88116e96a127b3b305fd1fae8dfe515 100644 (file)
@@ -55,7 +55,7 @@ public abstract class JcrFileSystemProvider extends FileSystemProvider {
                        }
                        if (!node.isNodeType(NodeType.NT_FILE))
                                throw new UnsupportedOperationException(node + " must be a file");
-                       return new BinaryChannel(node);
+                       return new BinaryChannel(node, path);
                } catch (RepositoryException e) {
                        discardChanges(node);
                        throw new IOException("Cannot read file", e);
@@ -66,6 +66,8 @@ public abstract class JcrFileSystemProvider extends FileSystemProvider {
        public DirectoryStream<Path> newDirectoryStream(Path dir, Filter<? super Path> filter) throws IOException {
                try {
                        Node base = toNode(dir);
+                       if (base == null)
+                               throw new IOException(dir + " is not a JCR node");
                        return new NodeDirectoryStream((JcrFileSystem) dir.getFileSystem(), base.getNodes(), filter);
                } catch (RepositoryException e) {
                        throw new IOException("Cannot list directory", e);
@@ -169,7 +171,7 @@ public abstract class JcrFileSystemProvider extends FileSystemProvider {
 
        @Override
        public boolean isHidden(Path path) throws IOException {
-               return false;
+               return path.getFileName().toString().charAt(0) == '.';
        }
 
        @Override