Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 46253 invoked from network); 12 Mar 2011 10:43:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Mar 2011 10:43:37 -0000 Received: (qmail 32284 invoked by uid 500); 12 Mar 2011 10:43:36 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 32159 invoked by uid 500); 12 Mar 2011 10:43:36 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 32151 invoked by uid 99); 12 Mar 2011 10:43:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Mar 2011 10:43:35 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [211.100.22.6] (HELO spam.nec.com.cn) (211.100.22.6) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Mar 2011 10:43:28 +0000 X-ASG-Debug-ID: 1299926581-078b004b0000-yrcYzN X-Barracuda-URL: http://172.28.88.136:8000/cgi-bin/mark.cgi Received: from internal-mail.nec.com.cn (localhost [127.0.0.1]) by spam.nec.com.cn (Spam Firewall) with ESMTP id 908DE3B972AF for ; Sat, 12 Mar 2011 18:43:01 +0800 (CST) Received: from internal-mail.nec.com.cn ([172.28.88.254]) by spam.nec.com.cn with ESMTP id 55tQgVH7IKbWmIJl for ; Sat, 12 Mar 2011 18:43:01 +0800 (CST) X-ASG-Whitelist: Sender Received: from neccn-cas01.nec.com.cn (localhost.localdomain [127.0.0.1]) by internal-mail.nec.com.cn (Postfix) with ESMTP id 041AA14641 for ; Sat, 12 Mar 2011 18:42:52 +0800 (CST) Received: from necasbj02817 (172.28.145.73) by neccn-cas01.nec.com.cn (172.28.88.51) with Microsoft SMTP Server id 8.2.176.0; Sat, 12 Mar 2011 18:42:04 +0800 From: chenxuejie To: 'Commons Users List' X-ASG-Orig-Subj: [NET]FTPSClient listFiles() throw SocketException when current directory's file is null. Subject: [NET]FTPSClient listFiles() throw SocketException when current directory's file is null. Date: Sat, 12 Mar 2011 18:42:54 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: Acvgoj48L0At/XhhQ2yOw6+coX3X+w== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Message-ID: X-Barracuda-Connect: UNKNOWN[172.28.88.254] X-Barracuda-Start-Time: 1299926581 X-Barracuda-Virus-Scanned: by Barracuda Spam Firewall at nec.com.cn X-Virus-Checked: Checked by ClamAV on apache.org Hi All. I use FTPSClient to list FTP server's directory. When FTP server's directory contains file, FTPSClient.listFiles() execute correctly. But, when FTP server's directory do not contains any file. it allways throw exception. My example code as follows. static void main(String[] args){ FTPSClient client = new FTPSClient(); //start to set KeyManager and TrustManager ..... client .setKeyManager(kmf.getKeyManagers()[0]); client .setTrustManager(tmf.getTrustManagers()[0]); //end set KeyManager and TrustManager client .connect(localhost, 21); client .login(guest,guest); client .execPROT("P"); client .execPBSZ(0); client .pwd(); client .pasv(); client .listFiles(); } Xuejie.Chen --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org