On 09.01.12 15:07, "Libin Joseph" <[email protected]> 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