dan-s1 commented on code in PR #8417:
URL: https://github.com/apache/nifi/pull/8417#discussion_r1511473945
##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncodeContent.java:
##########
@@ -171,9 +218,22 @@ public void process(final InputStream in, final
OutputStream out) throws IOExcep
private static class EncodeBase32 implements StreamCallback {
+ private int lineLength;
+ private String lineSeparator;
Review Comment:
```suggestion
private final int lineLength;
private final String lineSeparator;
```
##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncodeContent.java:
##########
@@ -129,31 +172,35 @@ public void onTrigger(final ProcessContext context, final
ProcessSession session
}
}
- private static StreamCallback getStreamCallback(final boolean encode,
final String encoding) {
- if (encode) {
- if (encoding.equalsIgnoreCase(BASE64_ENCODING)) {
- return new EncodeBase64();
- } else if (encoding.equalsIgnoreCase(BASE32_ENCODING)) {
- return new EncodeBase32();
- } else {
- return new EncodeHex();
- }
- } else {
- if (encoding.equalsIgnoreCase(BASE64_ENCODING)) {
- return new DecodeBase64();
- } else if (encoding.equalsIgnoreCase(BASE32_ENCODING)) {
- return new DecodeBase32();
- } else {
- return new DecodeHex();
- }
+ private static StreamCallback getStreamCallback(final boolean encode,
final EncodingType encoding,
+ final int lineLength, final String lineSeparator) {
+ switch(encoding) {
+ case BASE64:
+ return encode ? new EncodeBase64(lineLength, lineSeparator) :
new DecodeBase64();
+ case BASE32:
+ return encode ? new EncodeBase32(lineLength, lineSeparator) :
new DecodeBase32();
+ default:
+ return encode ? new EncodeHex() : new DecodeHex();
}
}
private static class EncodeBase64 implements StreamCallback {
+ private int lineLength;
+ private String lineSeparator;
Review Comment:
Intellij points out these should be final
```suggestion
private final int lineLength;
private final String lineSeparator;
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]