From: Dmitriy S. <sha...@gm...> - 2015-07-04 08:59:15
|
On Sat, Jul 4, 2015 at 11:28 AM, Hungerburg <pc...@my...> wrote: > Am 2015-07-03 um 19:28 schrieb Dmitriy Shabanov: > > We should agree on something here and now, > > because, for example, oXygen can create document at eXist by webdav > > interface (other protocols allow that too) and that document will not > > allow to list collection or remove it. > > > > Here the trace of exception on document request: > > > > java.lang.IllegalArgumentException: Invalid URI: xmldb URI scheme has no > > instance name: xmldb:exercise%20 > > at org.exist.xmldb.XmldbURI.create(XmldbURI.java:188) > > at org.exist.xmldb.XmldbURI.lastSegment(XmldbURI.java:500) > > at > org.exist.storage.NativeBroker.getXMLResource(NativeBroker.java:2223) > > Out of my special interest in URL handling, I tried to manually trace > how to get from XmldbURI.create to the exception, from String to URI to > String and back again: > > XmldbURI.create(String) > XmldbURI.xmldbUriFor(String) > XmldbURI.xmldbUriFor(String, Bool) > java.net.URI new(escaped String) > XmldbURI.getXmldbURI(URI) > FullXmldbURI new(URI) > XmldbURI.xmldbURI(URI, Bool) > xmldbURI.URI.toString().trim() > xmldbURI.normalize() > java.net.URI new(truncated String) > FullXmldbURI.parseURI(URI, Bool) > > Probably, thats not really what happens, the class is hell: "… to keep > memory usage low" it says ;) > > > XmldbURI uri = XmldbURI.create("/db/xmldb:something #1.dita"); > > Regarding RFC 3986, that looks to me like a *decoded* path component > with two segments ("db", "xmldb:something ") and a fragment ("1.dita") > too; if it should be a path only, the crosshatch would have to be remain > quoted even after decoding. > In case of RFC 3986 here is "/db/xmldb" scheme, "something " hier-part and "1.dita" fragment. https://www.ietf.org/rfc/rfc3986.txt section 3. And that mean that most of dbs have illegal resource name. Encoding may help, but should XmldbURI follow RFC 3986? -- Dmitriy Shabanov |