jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dinesh Dani <dreams.dee...@gmail.com>
Subject Unable to add the file and file content
Date Fri, 11 Jun 2010 01:12:23 GMT

I am new for jackrabbit and I want to add a file and its content in
node,does anyone can let me know the step by step method(or sample code) to
add a file

        Node root = session.getRootNode();
         Node forFileNode = root.addNode("testNode");
         System.out.println("the value of node is
          Node resNode = forFileNode.addNode ("jcr:content", "nt:resource");
          resNode.setProperty ("jcr:mimeType", "text/plain");
             resNode.setProperty ("jcr:encoding", "utf8");
             resNode.setProperty("jcr:data", new FileInputStream(f));

I am able to create the node and able to see the added node in DAV explorer
but unable to create the file

Thanks in Advance

View raw message