jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: Trouble in saving excel file to jackrabbit node
Date Tue, 10 Jan 2012 12:34:43 GMT
On 09.01.12 15:07, "Libin Joseph" <libin.eferns@gmail.com> wrote:
>I am trying to save an excel file that a user uploads using a
>web browser, but i am getting an error "*javax.jcr.pathnotfoundexception"

Which method throws?

>Node folder = session.getRootNode();
>Node upld=folder.getNode("Traffic Software")
>        .getNode("Client Node").getNode("Bookings");

Maybe here? Then the path "/Traffic Software/Client Node/Bookings" might
not exist in your repo.

>Node file = upld.addNode(fileName, "nt:file");
>Node resNode = file.addNode ("jcr:content", "nt:resource");
>file.addMixin(JcrConstants.MIX_VERSIONABLE);
>Node fileContent = file.getNode("jcr:content");

Note that fileContent is the same as resNode here, so you don't have to
fetch it again.

>fileContent.setProperty("jcr:data", fileStream);
>session.save();

Cheers,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel





Mime
View raw message