Hello, I am a newbie with a question.

My goal is to create a repository that mirrors a local filesystem, I have a problem with file names.
The problem is "This file will fail because of the ' character.txt".
The line that fails is
       Node fileNode = folderNode.addNode(file.getName(), "nt:file");

I have only tested this on  jdk build 1.6.0-rc-b103 on windows xp.

Exception in thread "main" javax.jcr.RepositoryException: failed to resolve path This file will fail because of the ' character.txt relative to /testdump4[2]: 'This file will fail because of the ' character.txt' is not a valid path: 'This file will fail because of the ' character.txt' is not a legal path element: 'This file will fail because of the ' character.txt' is not a valid path: 'This file will fail because of the ' character.txt' is not a legal path element at org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:712) at org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:687)
   at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:1925)
   at helloJackrabbit.Writer.importFile(Writer.java:106)
   at helloJackrabbit.Writer.getFileListing(Writer.java:89)
   at helloJackrabbit.Writer.main(Writer.java:50)
Caused by: org.apache.jackrabbit.name.MalformedPathException: 'This file will fail because of the ' character.txt' is not a valid path: 'This file will fail because of the ' character.txt' is not a legal path element
   at org.apache.jackrabbit.name.PathFormat.parse(PathFormat.java:191)
at org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:698)
   ... 5 more
org.apache.jackrabbit.name.MalformedPathException: 'This file will fail because of the ' character.txt' is not a valid path: 'This file will fail because of the ' character.txt' is not a legal path element
   at org.apache.jackrabbit.name.PathFormat.parse(PathFormat.java:191)
at org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:698) at org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:687)
   at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:1925)
   at helloJackrabbit.Writer.importFile(Writer.java:106)
   at helloJackrabbit.Writer.getFileListing(Writer.java:89)
   at helloJackrabbit.Writer.main(Writer.java:50)

****

*-
Thomas Frössman*: Intermedia production at Jossystem <http://www.jossystem.se> & Polorization <http://www.polorization.net>
contact | [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> - +46704666133

Reply via email to