NIFI-8250 - This closes #4838. UTF8 encoding for FTP processors

Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
Pierre Villard 2021-02-23 16:35:15 +04:00 committed by Joe Witt
parent 3cb26aec72
commit 9101160cbf
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
2 changed files with 2 additions and 0 deletions

View File

@ -101,6 +101,7 @@ public class ListFTP extends ListFileTransfer {
properties.add(ListedEntityTracker.TRACKING_STATE_CACHE);
properties.add(ListedEntityTracker.TRACKING_TIME_WINDOW);
properties.add(ListedEntityTracker.INITIAL_LISTING_TARGET);
properties.add(FTPTransfer.UTF8_ENCODING);
return properties;
}

View File

@ -603,6 +603,7 @@ public class FTPTransfer implements FileTransfer {
final boolean useUtf8Encoding = ctx.getProperty(UTF8_ENCODING).isSet() ? ctx.getProperty(UTF8_ENCODING).asBoolean() : false;
if (useUtf8Encoding) {
client.setControlEncoding("UTF-8");
client.setAutodetectUTF8(useUtf8Encoding);
}
client.connect(inetAddress, ctx.getProperty(PORT).evaluateAttributeExpressions(flowFile).asInteger());