exceptionfactory commented on code in PR #6030:
URL: https://github.com/apache/nifi/pull/6030#discussion_r872434557
##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FTPTransfer.java:
##########
@@ -321,13 +325,22 @@ public FlowFile getRemoteFile(final String
remoteFileName, final FlowFile origFl
FlowFile resultFlowFile;
try (InputStream in = client.retrieveFileStream(remoteFileName)) {
if (in == null) {
- final String response = client.getReplyString();
- // FTPClient doesn't throw exception if file not found.
- // Instead, response string will contain: "550 Can't open
<absolute_path>: No such file or directory"
- if (response != null && response.trim().endsWith("No such file
or directory")) {
- throw new FileNotFoundException(response);
+ final int replyCode = client.getReplyCode();
+
+ final String reply = client.getReplyString();
+ if (reply == null) {
Review Comment:
Thanks for the feedback @joewitt! After taking a closer look at the
commons-net FTP code, it appears that the FTP client will through an exception
if the reply string is `null` when attempting to parse the reply code, so will
move `getReplyCode()` after `getReplyString()`.
--
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]