eaolson commented on a change in pull request #4854:
URL: https://github.com/apache/nifi/pull/4854#discussion_r597310712



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/NiFiPropertiesLoader.java
##########
@@ -174,6 +177,19 @@ ProtectedNiFiProperties 
readProtectedPropertiesFromDisk(File file) {
             rawProperties.load(inStream);
             logger.info("Loaded {} properties from {}", rawProperties.size(), 
file.getAbsolutePath());
 
+            // Trim whitespace from each property. If property is multi-line, 
remove anything after the first line break.
+            Set<String> keys = rawProperties.stringPropertyNames();
+            Iterator<String> itr = keys.iterator();
+            final Pattern whitespaceRegex = Pattern.compile("\\s+$");
+            while(itr.hasNext()){
+                String key = itr.next();
+                String prop = rawProperties.getProperty(key);
+                if(!prop.isEmpty()){

Review comment:
       I'm not really familiar with the Apache Commons library (yet). I've made 
the suggested change.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to