Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 29876673E for ; Tue, 26 Jul 2011 00:07:51 +0000 (UTC) Received: (qmail 34672 invoked by uid 500); 26 Jul 2011 00:07:49 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 34546 invoked by uid 500); 26 Jul 2011 00:07:49 -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 34538 invoked by uid 99); 26 Jul 2011 00:07:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 00:07:48 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.160.171] (HELO mail-gy0-f171.google.com) (209.85.160.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 00:07:42 +0000 Received: by gyh20 with SMTP id 20so2774140gyh.30 for ; Mon, 25 Jul 2011 17:07:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.146.160.32 with SMTP id i32mr4579379yae.18.1311638841238; Mon, 25 Jul 2011 17:07:21 -0700 (PDT) Received: by 10.147.169.15 with HTTP; Mon, 25 Jul 2011 17:07:20 -0700 (PDT) Received: by 10.147.169.15 with HTTP; Mon, 25 Jul 2011 17:07:20 -0700 (PDT) In-Reply-To: <1311626514.8332.YahooMailClassic@web161715.mail.bf1.yahoo.com> References: <1311626012.18026.ezmlm@commons.apache.org> <1311626514.8332.YahooMailClassic@web161715.mail.bf1.yahoo.com> Date: Mon, 25 Jul 2011 20:07:20 -0400 Message-ID: Subject: Re: Help with change directory From: James Carman To: Commons Users List Content-Type: multipart/alternative; boundary=000e0cd34dae34a3b504a8edb712 --000e0cd34dae34a3b504a8edb712 Content-Type: text/plain; charset=ISO-8859-1 Try vfs On Jul 25, 2011 4:42 PM, "Diane Baumgartner" wrote: > I'm new to Apache Commons (3.0.1), and am writing a Java program to FTP a file on my local server to an FTP server on the same network. > > First, I'd like to make sure that changeWorkingDirectory() changes the directory on the remote machine. It's not clear from the documentation. > > The first thing hat happens is that the "Change Directory didn't work" prints out. but I don't know what went wrong. So, I'm trying to use getReply() for more information, but my program hangs on that line. I know this becuase the line before it prints, but not the line after it. > > Here's a code snippet: > > FTPClient ftp = new FTPClient(); > ftp.connect (server); > > // status checking here - print statements indicate that connect was successful > > boolean OK = ftp.changeWorkingDirectory ("/tmp/dir_name"); > if {OK} { > System.out.println ("Change directory worked"); > } else { > System.out.println ("Change directory didn't work"); > system.out.println ("The FTP Reply Code is"); > > reply = ftp.getReply(); // reply was defined as int before doing the connect previous to this > System.out.println (Reply); > } > > Thanks for any help you can offer. --000e0cd34dae34a3b504a8edb712--