This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-net.git
commit c317102cbb911d2b5e36151e4d0c7ae856d074fe Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Feb 24 13:40:10 2024 -0500 Internal refactoring --- src/main/java/org/apache/commons/net/ftp/FTP.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/net/ftp/FTP.java b/src/main/java/org/apache/commons/net/ftp/FTP.java index b888a4b2..a8556b0e 100644 --- a/src/main/java/org/apache/commons/net/ftp/FTP.java +++ b/src/main/java/org/apache/commons/net/ftp/FTP.java @@ -907,6 +907,10 @@ public class FTP extends SocketClient { return sendCommand(FTPCmd.MODE, MODES.substring(mode, mode + 1)); } + private char modeCharAt(final int fileType) { + return MODES.charAt(fileType); + } + /** * A convenience method to send the FTP NLST command to the server, receive the reply, and return the reply code. Remember, it is up to you to manage the * data connection. If you don't need this low level of access, use {@link org.apache.commons.net.ftp.FTPClient} , which will handle all low level details @@ -1444,12 +1448,12 @@ public class FTP extends SocketClient { */ public int type(final int fileType, final int formatOrByteSize) throws IOException { final StringBuilder arg = new StringBuilder(); - arg.append(MODES.charAt(fileType)); + arg.append(modeCharAt(fileType)); arg.append(' '); if (fileType == LOCAL_FILE_TYPE) { arg.append(formatOrByteSize); } else { - arg.append(MODES.charAt(formatOrByteSize)); + arg.append(modeCharAt(formatOrByteSize)); } return sendCommand(FTPCmd.TYPE, arg.toString());