apache / apache/jmeter

includecontroller.prefix fails when path separator not added

Open
#4,909 2 comments 0 reactions 0 assignees View on GitHub
enhancement os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Andrew Burton** ([Bug 62878](https://bz.apache.org/bugzilla//show_bug.cgi?id=62878&redirect=false)):
Specifying the includecontroller.prefix fails if the property or the specified include filename don't end/start with a path separator.

For example:
includecontroller.prefix=/path/to/fragments
Include Controller filename = myfragment.jmx
results in the log message:
\"/path/to/fragmentsmyfragment.jmx\" not found for Include Controller \"Include Controller - My Fragment\"

This is due to the string append used in IncludeController.java:

String fileName=prefix+includePath;
File file = new File(fileName);

Suggest the code be amended to:

File file = Paths.get(prefix, includePath).toFile();

This way, the user input is handled gracefully. This assumes that the prefix is a directory.

OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.