jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Unable to add the file and file content
Date Sun, 13 Jun 2010 17:10:31 GMT
On Fri, Jun 11, 2010 at 03:12, Dinesh Dani <dreams.deepak@gmail.com> wrote:
>         Node root = session.getRootNode();
>          Node forFileNode = root.addNode("testNode");

The file node should have the "nt:file" node type:

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


>          System.out.println("the value of node is
> ::::"+forFileNode.getName());
>           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));
>              session.save();

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message