You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some unimportant reason, we have sometimes windows style path names with backslashes in our config files when we do development on Windows. In our test cases, we load the config.xml from a Java resource. However, IOUtils.resolveFileOrResource() does not treat the backslashes correctly.
The resulting URL:
INFO o.m.c.u.i.IOUtils:205 Resolved scenarios\config.xml to file:/C:/.../target/classes/scenarios%5ccconfig.xml
has the backslashes converted to %5c. It can indeed be read, so that's not the immediate problem, but that path also ends up in Config.setContext() and later in IOUtils.extendUrl(). The extendUrl() however does not work correctly and puts relative paths now relative to file:/C:/.../target/classes/ instead of file:/C:/.../target/classes/scenarios
A simple fix would be to just replace all backslashes with forward slashes in IOUtils.resolveFileOrResource(). If you want Linux users to be able to use \ as a valid filename character, that replacing may only happen in the windows world (although I would never advise somebody to use \ inside a filename anyway :)
The text was updated successfully, but these errors were encountered:
For some unimportant reason, we have sometimes windows style path names with backslashes in our config files when we do development on Windows. In our test cases, we load the
config.xml
from a Java resource. However,IOUtils.resolveFileOrResource()
does not treat the backslashes correctly.The resulting URL:
INFO o.m.c.u.i.IOUtils:205 Resolved scenarios\config.xml to file:/C:/.../target/classes/scenarios%5ccconfig.xml
has the backslashes converted to
%5c
. It can indeed be read, so that's not the immediate problem, but that path also ends up inConfig.setContext()
and later inIOUtils.extendUrl()
. TheextendUrl()
however does not work correctly and puts relative paths now relative tofile:/C:/.../target/classes/
instead offile:/C:/.../target/classes/scenarios
A simple fix would be to just replace all backslashes with forward slashes in
IOUtils.resolveFileOrResource()
. If you want Linux users to be able to use \ as a valid filename character, that replacing may only happen in the windows world (although I would never advise somebody to use \ inside a filename anyway :)The text was updated successfully, but these errors were encountered: