Hi Audrey,

2010/7/29 Audrey Colbrant <[email protected]>

> Hi,
>
> I am trying to create a file from server side following some examples, but
> no way, the file is not created.
> I have had a look to server logs but I don't find any error and the source
> code is not throwing anything.
>
> Here the piece of code:
>            Node root = session.getRootNode();
>            Node userRoute=root.getNode("content/myProjectNode");
>
>            Node fileNode = userRoute.addNode("myFile.gpx", "nt:file");
>            Node resNode = fileNode.addNode("jcr:content", "nt:resource");
>
>            resNode.setProperty("jcr:mimeType", "text/xml");
>            resNode.setProperty("jcr:encoding", "UTF-8");
>
>  
> resNode.setProperty("jcr:lastModified",Calendar.getInstance().getTimeInMillis());
>            resNode.setProperty("jcr:data",new
> ByteArrayInputStream(myString.getBytes()) );
>
>

A stupid question: did you call save() method on the root node?

-- 
Federico

Reply via email to