You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2019/03/29 15:31:17 UTC

[nifi-minifi] branch master updated: MINIFI-497 С2 Server: Fix wrong regex pattern in "getConfiguration" (NiFiRestConfigurationProvider.java)

This is an automated email from the ASF dual-hosted git repository.

aldrin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 484bdb9  MINIFI-497 С2 Server: Fix wrong regex pattern in "getConfiguration" (NiFiRestConfigurationProvider.java)
484bdb9 is described below

commit 484bdb92e74432d5495e75eaad3229bf8369f201
Author: Vladimir Mikhailov <19...@users.noreply.github.com>
AuthorDate: Thu Mar 28 15:53:49 2019 +0500

    MINIFI-497 С2 Server: Fix wrong regex pattern in "getConfiguration" (NiFiRestConfigurationProvider.java)
    
    This closes #151.
    
    Signed-off-by: Aldrin Piri <al...@apache.org>
---
 .../minifi/c2/provider/nifi/rest/NiFiRestConfigurationProvider.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/minifi-c2/minifi-c2-provider/minifi-c2-provider-nifi-rest/src/main/java/org/apache/nifi/minifi/c2/provider/nifi/rest/NiFiRestConfigurationProvider.java b/minifi-c2/minifi-c2-provider/minifi-c2-provider-nifi-rest/src/main/java/org/apache/nifi/minifi/c2/provider/nifi/rest/NiFiRestConfigurationProvider.java
index 8f0bf2c..6067d7c 100644
--- a/minifi-c2/minifi-c2-provider/minifi-c2-provider-nifi-rest/src/main/java/org/apache/nifi/minifi/c2/provider/nifi/rest/NiFiRestConfigurationProvider.java
+++ b/minifi-c2/minifi-c2-provider/minifi-c2-provider-nifi-rest/src/main/java/org/apache/nifi/minifi/c2/provider/nifi/rest/NiFiRestConfigurationProvider.java
@@ -102,7 +102,7 @@ public class NiFiRestConfigurationProvider implements ConfigurationProvider {
 
         String id = null;
         if (version == null) {
-            String filenamePattern = Arrays.stream(filename.split(Pattern.quote("${version}"), -1)).map(Pattern::quote).collect(Collectors.joining("([0-9+])"));
+            String filenamePattern = Arrays.stream(filename.split(Pattern.quote("${version}"), -1)).map(Pattern::quote).collect(Collectors.joining("([0-9]+)"));
             Pair<String, Integer> maxIdAndVersion = getMaxIdAndVersion(filenamePattern);
             id = maxIdAndVersion.getFirst();
             version = maxIdAndVersion.getSecond();