Nick Tarallo created VFS-863:
--------------------------------
Summary: Content inside brackets in directory names is not decoded
Key: VFS-863
URL: https://issues.apache.org/jira/browse/VFS-863
Project: Commons VFS
Issue Type: Bug
Affects Versions: 2.10.0
Reporter: Nick Tarallo
Fix For: 2.11.0
`UriParser.decode()` was changed in 2.10.0 to avoid decoding content inside of
brackets in paths since it may be an IPv6 host ([PR
HERE|[https://github.com/apache/commons-vfs/pull/438/changes#diff-731c9fd149c7d934456163a6eb8c1afebc6be0669986e8ccf5092f164ea0cd30R166]]).
However, for local file directory paths, this may not be an IPv6 host.
An example test that passes in 2.9.0 but fails in 2.10.0 is the following:
{code:java}
@Test
public void vfsGetUrlRoundTripIdentity() throws Exception {
Path tmp = Files.createTempDirectory("vfs-roundtrip");
try {
Path child = tmp.resolve("outside%text[inside%text]tail");
Files.createDirectories(child);
FileSystemManager mgr = VFS.getManager();
FileObject a = mgr.resolveFile(child.toUri().toString());
FileObject b = mgr.resolveFile(a.getURL().toString());
assertEquals(a.getName().getPath(), b.getName().getPath());
} finally {
FileUtils.deleteDirectory(tmp.toFile());
}
} {code}
[USER MAILING LIST THREAD
HERE|https://lists.apache.org/thread/cj9gs0smdvdzyw3fjpxqnq0xg0525bmc]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)