joewitt commented on code in PR #6030:
URL: https://github.com/apache/nifi/pull/6030#discussion_r872417635


##########
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:
   I did not review the ftp client code but I'd imagine the reply code is 
extracted by it from the reply string.  Here we pull the code, then the string, 
then check if the string is null.  I suspect we want code extraction AFTER the 
null and/or empty check.



-- 
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]

Reply via email to