Skip to content

Commit

Permalink
Merge pull request #4650 from Pask42/correction-bug-ftp
Browse files Browse the repository at this point in the history
Fix: Set FTP file type to binary if binaryMode is enabled
  • Loading branch information
hansva authored Dec 10, 2024
2 parents d73cc99 + 8bf7e89 commit b9f2bde
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.vfs2.FileObject;
Expand Down Expand Up @@ -436,6 +437,10 @@ public Result execute(Result previousResult, int nr) {
limitFiles = Const.toInt(resolve(getNrLimit()), 10);
}

if (binaryMode) {
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
}

// Get the files in the list...
for (FTPFile ftpFile : ftpFiles) {

Expand Down

0 comments on commit b9f2bde

Please sign in to comment.