How to write an nt:file programmatically
问题 I'm trying to store binary data in JCR, which is created on the fly. My problem is that the only way provided by the JCR API is via an InputStream : Session session = request.getResourceResolver().adaptTo(Session.class); ValueFactory valueFactory = session.getValueFactory(); Binary bin = valueFactory.createBinary(is); As CQ/Sling is RESTful I can see why this is the case as you usually get a form post or an httprequest to another source, where you always have an InputStream to use. But in my