Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 89D11B874 for ; Sat, 7 Jan 2012 00:44:52 +0000 (UTC) Received: (qmail 73030 invoked by uid 500); 7 Jan 2012 00:44:52 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 72903 invoked by uid 500); 7 Jan 2012 00:44:51 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 72896 invoked by uid 99); 7 Jan 2012 00:44:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2012 00:44:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2012 00:44:48 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B98182388A2C for ; Sat, 7 Jan 2012 00:44:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120107004427.B98182388A2C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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);