Can browse node file system
[lgpl/argeo-commons.git] / org.argeo.jcr / src / org / argeo / jcr / fs / JcrBasicfileAttributes.java
index e59abbc70a8a1fc1f65556c4208b7946eb2c5b96..7ce9ca6674e4d3cff9e7d5241fcb8652b9d821d8 100644 (file)
@@ -63,7 +63,10 @@ public class JcrBasicfileAttributes implements NodeFileAttributes {
        @Override
        public boolean isDirectory() {
                try {
-                       return node.isNodeType(NodeType.NT_FOLDER);
+                       if (node.isNodeType(NodeType.NT_FOLDER))
+                               return true;
+                       // all other non file nodes
+                       return !(node.isNodeType(NodeType.NT_FILE) || node.isNodeType(NodeType.NT_LINKED_FILE));
                } catch (RepositoryException e) {
                        throw new JcrFsException("Cannot check if directory", e);
                }
@@ -88,7 +91,7 @@ public class JcrBasicfileAttributes implements NodeFileAttributes {
                if (isRegularFile()) {
                        Binary binary = null;
                        try {
-                               binary = node.getNode(Property.JCR_DATA).getProperty(Property.JCR_CONTENT).getBinary();
+                               binary = node.getNode(Property.JCR_CONTENT).getProperty(Property.JCR_DATA).getBinary();
                                return binary.getSize();
                        } catch (RepositoryException e) {
                                throw new JcrFsException("Cannot check size", e);