Re: [VFS] Possible regression in path decoding between 2.9.0 and 2.10.0

Gary Gregory <[email protected]> Thu, 25 Jun 2026 23:56:04 -0400
Newsgroups gmane.comp.jakarta.commons.user
Message-ID <CACZkXPyEpbKzUOZN-DmYCs-D6Z1eeOAYXsT8h0na3jQYLKjMuA@mail.gmail.com>
--0000000000002887210655201719
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 25, 2026, 23:02 Nick Tarallo <[email protected]> wrote:

> Hi everyone,
>
> Just following up on this to see if anybody has any insight into this
> issue and whether it is a bug or not. Workaround suggestions would
> also be appreciated.
>

Hello Nick,

I've not had a chance to look at this one but if you have time to create a
PR, that would be great.

Gary

>
> Thanks again,
> Nick
>
> On Wed, Jun 17, 2026 at 7:57=E2=80=AFPM Nick Tarallo <nicktarallo3@gmail.=
com>
> wrote:
> >
> > Hello,
> >
> > I have encountered a possible regression between VFS 2.9.0 and 2.10.0
> > related to file path encoding.
> >
> > I would expect resolving a file from a URL and then resolving the URL
> > returned by getURL() to preserve the same path, but that does not
> > appear to happen in 2.10.0. The following test case from my project
> > passes with 2.9.0 but fails with 2.10.0:
> >
> > @Test
> > public void vfsGetUrlRoundTripIdentity() throws Exception {
> >    Path tmp =3D Files.createTempDirectory("vfs-roundtrip");
> >    try {
> >       Path child =3D tmp.resolve("outside%text[inside%text]tail");
> >       Files.createDirectories(child);
> >
> >       FileSystemManager mgr =3D VFS.getManager();
> >       FileObject a =3D mgr.resolveFile(child.toUri().toString());
> >       FileObject b =3D mgr.resolveFile(a.getURL().toString());
> >
> >       assertEquals(a.getName().getPath(), b.getName().getPath());
> >    } finally {
> >       FileUtils.deleteDirectory(tmp.toFile());
> >    }
> > }
> >
> > The assertion failure is:
> >
> > Expected:
> > .../outside%25text[inside%25text]tail
> >
> > Actual:
> > .../outside%25text[inside%2525text]tail
> >
> > I noticed that URIParser.decode() changed in PR #438 [1], and I am
> > wondering whether the behavior could be related to that change. It
> > appears that content inside brackets is treated specially to avoid
> > decoding IPv6 hosts, but I am not sure whether that logic should apply
> > to local file paths.
> >
> > Is this expected behavior, or does it sound like a regression?
> >
> > Thanks,
> > Nick
> >
> > [1]
> https://github.com/apache/commons-vfs/pull/438/changes#diff-731c9fd149c7d=
934456163a6eb8c1afebc6be0669986e8ccf5092f164ea0cd30R166
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

--0000000000002887210655201719--