Vladimir Mikhailov created MINIFI-497:
-----------------------------------------
Summary: С2 Server: wrong regex pattern in "getConfiguration"
(NiFiRestConfigurationProvider.java)
Key: MINIFI-497
URL: https://issues.apache.org/jira/browse/MINIFI-497
Project: Apache NiFi MiNiFi
Issue Type: Bug
Components: Command and Control
Affects Versions: 0.5.0
Reporter: Vladimir Mikhailov
C2 Server can't get from NiFi templates with versions v10+, only v1-v9.
The reason is an error in the "getConfiguration" function, where
"filenamePattern" is determined.
Wrong code (maybe a typo?):
{code:java}
String filenamePattern =
Arrays.stream(filename.split(Pattern.quote("${version}"),
-1)).map(Pattern::quote).collect(Collectors.joining("([0-9+])"));
{code}
It should be:
{code:java}
String filenamePattern =
Arrays.stream(filename.split(Pattern.quote("${version}"),
-1)).map(Pattern::quote).collect(Collectors.joining("([0-9]+)"));
{code}
{code:java}
[0-9+] -> [0-9]+{code}
Link to source code:
https://github.com/apache/nifi-minifi/blob/master/minifi-c2/minifi-c2-provider/minifi-c2-provider-nifi-rest/src/main/java/org/apache/nifi/minifi/c2/provider/nifi/rest/NiFiRestConfigurationProvider.java#L105
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)