commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1086826 - in /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp: FTPSClient.java FTPSCommand.java
Date Wed, 30 Mar 2011 02:42:35 GMT
Author: sebb
Date: Wed Mar 30 02:42:34 2011
New Revision: 1086826

URL: http://svn.apache.org/viewvc?rev=1086826&view=rev
Log:
Use getCommand() method rather than direct array access

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java?rev=1086826&r1=1086825&r2=1086826&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java Wed
Mar 30 02:42:34 2011
@@ -195,7 +195,7 @@ public class FTPSClient extends FTPClien
      */
     private void execAUTH() throws SSLException, IOException {
         int replyCode = sendCommand(
-                FTPSCommand._commands[FTPSCommand.AUTH], auth);
+                FTPSCommand.getCommand(FTPSCommand.AUTH), auth);
         if (FTPReply.SECURITY_MECHANISM_IS_OK == replyCode) {
             // replyCode = 334
             // I carry out an ADAT command.
@@ -407,7 +407,7 @@ public class FTPSClient extends FTPClien
         if (pbsz < 0 || 4294967295L < pbsz)
             throw new IllegalArgumentException();
         if (FTPReply.COMMAND_OK != sendCommand(
-                FTPSCommand._commands[FTPSCommand.PBSZ],String.valueOf(pbsz)))
+                FTPSCommand.getCommand(FTPSCommand.PBSZ),String.valueOf(pbsz)))
             throw new SSLException(getReplyString());
     }
 
@@ -431,7 +431,7 @@ public class FTPSClient extends FTPClien
         if (prot == null) prot = DEFAULT_PROT;
         if (!checkPROTValue(prot)) throw new IllegalArgumentException();
         if (FTPReply.COMMAND_OK != sendCommand(
-                FTPSCommand._commands[FTPSCommand.PROT], prot))
+                FTPSCommand.getCommand(FTPSCommand.PROT), prot))
             throw new SSLException(getReplyString());
         if (DEFAULT_PROT.equals(prot)) {
             setSocketFactory(null);
@@ -469,7 +469,7 @@ public class FTPSClient extends FTPClien
     public int sendCommand(String command, String args) throws IOException {
         int repCode = super.sendCommand(command, args);
         /* If CCC is issued, restore socket i/o streams to unsecured versions */
-        if (FTPSCommand._commands[FTPSCommand.CCC].equals(command)) {
+        if (FTPSCommand.getCommand(FTPSCommand.CCC).equals(command)) {
             if (FTPReply.COMMAND_OK == repCode) {
                 _socket_.close();
                 _socket_ = plainSocket;

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java?rev=1086826&r1=1086825&r2=1086826&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSCommand.java Wed
Mar 30 02:42:34 2011
@@ -34,7 +34,7 @@ public final class FTPSCommand {
     public static final int DATA_CHANNEL_PROTECTION_LEVEL = PROT;
     public static final int CLEAR_COMMAND_CHANNEL = CCC;
 
-    static final String[] _commands = {"AUTH","ADAT","PBSZ","PROT","CCC"};
+    private static final String[] _commands = {"AUTH","ADAT","PBSZ","PROT","CCC"};
 
     /**
      * Retrieve the FTPS command string corresponding to a specified



Mime
View raw message