commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1228525 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
Date Sat, 07 Jan 2012 00:44:27 GMT
Author: sebb
Date: Sat Jan  7 00:44:27 2012
New Revision: 1228525

URL: http://svn.apache.org/viewvc?rev=1228525&view=rev
Log:
Throw IllegalStateException if mode is not passive

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

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java?rev=1228525&r1=1228524&r2=1228525&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java Sat
Jan  7 00:44:27 2012
@@ -57,12 +57,17 @@ public class FTPHTTPClient extends FTPCl
     }
 
 
+    /**
+     * {@inheritDoc}
+     *
+     * @throws IllegalStateException if connection mode is not passive
+     */
     @Override
     protected Socket _openDataConnection_(int command, String arg) 
     throws IOException {
         //Force local passive mode, active mode not supported by through proxy
         if (getDataConnectionMode() != PASSIVE_LOCAL_DATA_CONNECTION_MODE) {
-            enterLocalPassiveMode();
+            throw new IllegalStateException("Only passive connection mode supported");
         }
 
         final boolean isInet6Address = getRemoteAddress() instanceof Inet6Address;
@@ -120,7 +125,7 @@ public class FTPHTTPClient extends FTPCl
         final String connectString = "CONNECT "  + host + ":" + port  + " HTTP/1.1";
         final String hostString = "Host: " + host + ":" + port;
 
-        output.write(connectString.getBytes("UTF-8"));
+        output.write(connectString.getBytes("UTF-8")); // TODO what is the correct encoding?
         output.write(CRLF);
         output.write(hostString.getBytes("UTF-8"));
  	    output.write(CRLF);



Mime
View raw message