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 871AE75FD for ; Sat, 12 Nov 2011 01:12:07 +0000 (UTC) Received: (qmail 52566 invoked by uid 500); 12 Nov 2011 01:12:07 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 52511 invoked by uid 500); 12 Nov 2011 01:12:07 -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 52501 invoked by uid 99); 12 Nov 2011 01:12:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Nov 2011 01:12:07 +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, 12 Nov 2011 01:12:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AE9962388993 for ; Sat, 12 Nov 2011 01:11:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1201139 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPClient.java Date: Sat, 12 Nov 2011 01:11:43 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111112011143.AE9962388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Sat Nov 12 01:11:43 2011 New Revision: 1201139 URL: http://svn.apache.org/viewvc?rev=1201139&view=rev Log: NET-425 Extend implementation to receiveFile and receiveFileStream methods. Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1201139&r1=1201138&r2=1201139&view=diff ============================================================================== --- commons/proper/net/trunk/src/changes/changes.xml (original) +++ commons/proper/net/trunk/src/changes/changes.xml Sat Nov 12 01:11:43 2011 @@ -61,6 +61,7 @@ TBA "> _openDataConnection_, __storeFile, and __storeFileStream should be protected and take String for FTP command. + Likewise for receiveFile and receiveFileStream. Increasing sub-negotiation message holder array size Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1201139&r1=1201138&r2=1201139&view=diff ============================================================================== --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Sat Nov 12 01:11:43 2011 @@ -1625,10 +1625,16 @@ implements Configurable public boolean retrieveFile(String remote, OutputStream local) throws IOException { + return _retrieveFile(FTPCommand.getCommand(FTPCommand.RETR), remote, local); + } + + protected boolean _retrieveFile(String command, String remote, OutputStream local) + throws IOException + { InputStream input; Socket socket; - if ((socket = _openDataConnection_(FTPCommand.RETR, remote)) == null) + if ((socket = _openDataConnection_(command, remote)) == null) return false; input = new BufferedInputStream(socket.getInputStream(), @@ -1688,10 +1694,16 @@ implements Configurable ***/ public InputStream retrieveFileStream(String remote) throws IOException { + return _retrieveFileStream(FTPCommand.getCommand(FTPCommand.RETR), remote); + } + + protected InputStream _retrieveFileStream(String command, String remote) + throws IOException + { InputStream input; Socket socket; - if ((socket = _openDataConnection_(FTPCommand.RETR, remote)) == null) + if ((socket = _openDataConnection_(command, remote)) == null) return null; input = socket.getInputStream();