jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudhan <s.kan...@gmail.com>
Subject Re: Create folder/directory code example?
Date Thu, 10 May 2007 22:57:21 GMT

Hi,

Here is a sample code for creating nt:folder :

Repository repository  = new TransientRepository();
Session session = repository.login(new SimpleCredentials("admin",
"admin".toCharArray()), null);
Node rn = session.getRootNode();
Node folderNode = rn.addNode("Folder", "nt:folder");
Node fileNode = folderNode.addNode(file.getName(), "nt:file");
Node contentNode = fileNode.addNode("jcr:content", "nt:resource");

-Sudhan



rhodebump wrote:
> 
> Hi,
> Can anyone provide me with a code snippet for creating an Node of
> nt:folder ?  
> I see the http://wiki.apache.org/jackrabbit/nt:folder page, but it's
> difficult for me to translate this into code for adding it to the
> repository.
> 
> Is there a standard attribute that contains the name of the folder?
> 
> Thanks in advance.
> Phillip
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Create-folder-directory-code-example--tf3723178.html#a10423064
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message