Github user alopresto commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2350#discussion_r159101417
--- Diff:
nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/properties/ConfigEncryptionTool.groovy
---
@@ -473,6 +536,34 @@ class ConfigEncryptionTool {
}
}
+ /**
+ * Loads the authorizers configuration from the provided file path.
+ *
+ * @param existingKeyHex the key used to encrypt the configs (defaults
to the current key)
+ *
+ * @return the file content
+ * @throw IOException if the authorizers.xml file cannot be read
+ */
+ private String loadAuthorizers(String existingKeyHex = keyHex) throws
IOException {
+ File authorizersFile
+ if (authorizersPath && (authorizersFile = new
File(authorizersPath)).exists()) {
+ try {
+ String xmlContent = authorizersFile.text
+ List<String> lines = authorizersFile.readLines()
+ logger.info("Loaded Authroizers content (${lines.size()}
lines)")
--- End diff --
I think this was copied from the LIP section and should be fixed there too
-- this is redundant. In order to capture the number of lines and get all the
contents as a single string, we should use the `readLines()` method and then
`join` the `List<String>`.
---