commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <brit...@apache.org>
Subject Re: [ALL] beware of URLs that represent file system locations
Date Tue, 14 Jun 2016 06:24:45 GMT
Well, I created the Jenkins Job, so we both hat our share ;-)

sebb <sebbaz@gmail.com> schrieb am Mo., 13. Juni 2016 um 16:03 Uhr:

> On 13 June 2016 at 12:43, Benedikt Ritter <britter@apache.org> wrote:
> > Thank you for bringing this up and for fixing the Problem!
>
> I probably caused it ...
>
> > sebb <sebbaz@gmail.com> schrieb am Mo., 13. Juni 2016 um 12:32:
> >
> >> A Commons NET test was failing on Jenkins, but worked fine locally.
> >> And previously had been working on Continuum.
> >>
> >> Turns out this was because Jenkins uses path names of the form
> >> .../commons-net@n/.
> >>
> >> The test code was using the following to get the source location:
> >>
> >> java.security.CodeSource.getLocation().getFile()
> >>
> >> The embedded '@' was returned encoded as %40.
> >>
> >> When used as a File parameter of course it did not work, so the test
> >> failed.
> >>
> >> Using java.net.URLDecoder.decode() on the file-part of the URL fixed
> this.
> >>
> >> There are no doubt other methods that return URLs that represent local
> >> file paths.
> >> Beware!
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message