You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/01/07 01:44:27 UTC

svn commit: r1228525 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java

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);