From: David B. <dj...@gm...> - 2020-11-24 18:21:07
|
Dear exist-open (cc Eduard, Peter), Have I understood correctly from the conversation below that eXist-db uses a broken Java constructor to convert filenames to URIs, that is, a constructor that incorrectly raises an error when operating on filenames that contain percent signs and square brackets, even though those characters can be percent-escaped and the percent-escaped versions can be used in URIs? If that is the case, this would appear to be a bug in eXist-db—perhaps a bug inherited from a faulty Java resource, but one that could be fixed within eXist-db resource management interfaces by shunning the faulty resource in favor of a (if necessary home-grown) compliant filename-to-URI conversion routine. Or have I misunderstood something about how filename-to-URI mapping is supposed to work? I did consult https://tools.ietf.org/html/rfc3986#section-2, which seems to tell me that filenames that contain percent signs and square brackets can be used as URIs by percent-encoding those (and other reserved) characters. Best, David On Tue, Nov 24, 2020 at 1:16 AM Eduard Drenth <ed...@fr...> wrote: > What I am saying is that exist-db uses this constrructor > > -----Original Message----- > *From*: Hungerburg 13 <pc...@my... > <Hungerburg%2013%20%3c...@my...%3e>> > *To*: exi...@li... > *Subject*: Re: [Exist-open] Filenames with awkward characters in eXist-db? > *Date*: Mon, 23 Nov 2020 23:27:04 +0100 > > Am 23.11.20 um 22:08 schrieb Eduard Drenth: > > Another followup on this one: > > > Under the hood java.net.URI is used, a URI with either % or brackets > > isn't valid, try: > > > new URI("test%percent.xml"); > > new URI("test[with]brackets.xml"); > > > > Not so quick! You should use another constructor, to work around such > > awkward characters, see attached java source - beware the path string > > then must start with a slash. > > > The error message is somehow misleading though. Perhaps the four > > argument constructor just can do a better guess at what is wanted, URIs > > are quite a complicated beast. > > > Peter > > _______________________________________________ > > Exist-open mailing list > > Exi...@li... > > > https://lists.sourceforge.net/lists/listinfo/exist-open > > > -- > > Eduard Drenth, Software Architekt > > ed...@fr... > > Doelestrjitte 8 > 8911 DX Ljouwert > +31 58 234 30 47 > +31 62 094 34 28 (privé) > > skype: eduarddrenth > https://github.com/eduarddrenth > frisian.eu > gpg: https://pgp.surfnet.nl/pks/lookup?search=eduarddrenth > > > Op freed bin ik thús/wurkje ik minder > > > > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |