2 Replies Latest reply on Aug 24, 2011 10:38 AM by Randall Hauch

    Issue with Binary Property

    jamat Newbie

      This:

         Node file = root.addNode(filename, "nt:file");

         Node content = file.addNode("jcr:content", "nt:resource");

         content.setProperty("jcr:data", in);

      with in=InputStream (in fact this is a FileInputStream) works fine.

       

      But this:

         Node file = root.addNode(filename, "nt:file");

         Node content = file.addNode("jcr:content", "nt:resource");

         Binary binary = session.getValueFactory().createBinary(in);

         content.setProperty("jcr:data", binary);

      does not.

       

      Reading the source code  it seems that the problem is in AbstractJcrNode.java:

          final JcrValue valueFrom( Binary value ) {

             ValueFactories factories = cache.factories();

              org.modeshape.graph.property.Binary binary = ((JcrBinary)value).binary();

              return new JcrValue(factories, cache, PropertyType.DATE, binary);

          }

      DATE is wrong. No ?