}
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);
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);
@Override
public boolean isHidden(Path path) throws IOException {
- return false;
+ return path.getFileName().toString().charAt(0) == '.';
}
@Override