-
Bug
-
Resolution: Done
-
Blocker
-
2.6.0.Beta2
-
None
This code works fine (note that "in" is a FileInputStream):
Node file = root.addNode(filename, "nt:file"); Node content = file.addNode("jcr:content", "nt:resource"); content.setProperty("jcr:data", in);
But this code does not:
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);
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 ?
Here's a link to the offending line: https://github.com/ModeShape/modeshape/blob/617b3ed4b24b55f97df8/modeshape-jcr/src/main/java/org/modeshape/jcr/AbstractJcrNode.java#L228