turcsanyip commented on a change in pull request #4370:
URL: https://github.com/apache/nifi/pull/4370#discussion_r452175081
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FileInfo.java
##########
@@ -217,6 +217,20 @@ public Builder group(String group) {
}
}
+ public static String permissionToString(int fileModeOctal) {
+ if (fileModeOctal > 0777 || fileModeOctal < 00) {
+ throw new RuntimeException("Invalid permission numerals");
Review comment:
Sorry, I did not catch it earlier, but generic exception types (like
`RuntimeException` or `Exception`) should not be thrown directly.
`IllegalArgumentException` would be appropriate for this case (don't forget
to update the tests too).
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FileInfo.java
##########
@@ -217,6 +217,20 @@ public Builder group(String group) {
}
}
+ public static String permissionToString(int fileModeOctal) {
+ if (fileModeOctal > 0777 || fileModeOctal < 00) {
+ throw new RuntimeException("Invalid permission numerals");
+ }
+ final char[] PERM = "xwrxwrxwr".toCharArray();
Review comment:
Sorry, I meant `static` in my previous comment.
----------------------------------------------------------------
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]