You can mount the JCR repository using the Webdav interface, and so you get a view of the repository as if it were all just files in folders.
I don't believe the files are stored in binary, they are really just plain text. Ross. Tim Terlegård <[email protected]> wrote on 01/04/2010 07:09:21 PM: > From: Tim Terlegård <[email protected]> > To: [email protected] > Date: 01/04/2010 07:10 PM > Subject: Sane file hierarchy when persisting file/folder nodes > > I'm investigating whether using Jackrabbit/JCR is a good abstraction > when dealing with files. > > I created a workspace (myspace) and used BundleFsPersistenceManager. > When I tried the code below it created the file > repository/workspaces/myspace/items/54/d6/c2bc4964477ab060d399ea532.n > I'd rather it create > repository/workspaces/myspace/items/hi.txt > > Is it possible to get a nice file hierarchy and not these random > numbers? And is it possible to store the files as plain text instead > of binary? > > Thanks, > Tim > > > Node root = session.getRootNode(); > Node fileNode = root.addNode("hi.txt", "nt:file"); > Node resNode = fileNode.addNode("jcr:content", "nt:resource"); > resNode.setProperty("jcr:mimeType", "text/plain"); > resNode.setProperty("jcr:encoding", "utf8"); > resNode.setProperty("jcr:data", new FileInputStream(new File("hi.txt"))); > session.save();
-- This message contains privileged and confidential information only for use by the intended recipient. If you are not the intended recipient of this message, you must not disseminate, copy or use it in any manner. If you have received this message in error, please advise the sender by reply e-mail. Please ensure all e-mail attachments are scanned for viruses prior to opening or using.
