jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Jansz <kevin.ja...@exari.com>
Subject Error creating file with square brackets in filename
Date Mon, 17 May 2010 01:51:53 GMT
On trying to PUT a file over webdav that has square brackets (ie '[' &
']') in its name I get a "500 Internal Server Error".

Trying to create the file using the JCR API:
file = folder.addNode("[Content_Types].xml", JcrConstants.NT_FILE);

Gives a bit more information:
Caused by: org.apache.jackrabbit.spi.commons.conversion.MalformedPathException:
'[Content_Types].xml' is not a valid path: Unterminated identifier
	at org.apache.jackrabbit.spi.commons.conversion.PathParser.parse(PathParser.java:295)
	at org.apache.jackrabbit.spi.commons.conversion.PathParser.parse(PathParser.java:120)
	at org.apache.jackrabbit.spi.commons.conversion.ParsingPathResolver.getQPath(ParsingPathResolver.java:90)
	at org.apache.jackrabbit.spi.commons.conversion.CachingPathResolver.getQPath(CachingPathResolver.java:98)
	at org.apache.jackrabbit.spi.commons.conversion.CachingPathResolver.getQPath(CachingPathResolver.java:77)
	at org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver.getQPath(DefaultNamePathResolver.java:82)
	at org.apache.jackrabbit.core.SessionImpl.getQPath(SessionImpl.java:729)
	at org.apache.jackrabbit.core.NodeImpl.addNodeWithUuid(NodeImpl.java:2038)
	... 15 more

So it seems that square brackets may need special handling/escaping?
In this case we don't have the ability to choose a different/better
name - '[Content_Types].xml' is a resource in all Open Office XML
(docx) files ...

Any comments/suggestions/work-arounds would be much appreciated.


Kevin Jansz
Level 7, 10-16 Queen Street, Melbourne 3000 Australia
Tel +61 3 9621 2773 | Fax +61 3 9621 2776
Exari Systems
Boston | London | Melbourne | Munich

Test drive our software online - www.exari.com/demo-trial.html
Read our blog on document assembly - blog.exari.com

View raw message