eaolson commented on a change in pull request #4854:
URL: https://github.com/apache/nifi/pull/4854#discussion_r597309953
##########
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()){
Review comment:
I think I'd been under the impression an Iterator was the preferred
method of looping over a collection (my Java is rusty), but this is simpler.
--
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]