Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 76680 invoked from network); 24 Mar 2008 17:02:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Mar 2008 17:02:23 -0000 Received: (qmail 5054 invoked by uid 500); 24 Mar 2008 17:02:18 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 4981 invoked by uid 500); 24 Mar 2008 17:02:17 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 4972 invoked by uid 99); 24 Mar 2008 17:02:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Mar 2008 10:02:17 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [140.172.10.145] (HELO paris.boulder.noaa.gov) (140.172.10.145) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Mar 2008 17:01:25 +0000 Received: from [140.172.179.20] (tabby.ngdc.noaa.gov [140.172.179.20]) by email.boulder.noaa.gov (iPlanet Messaging Server 5.2 HotFix 2.01 (built Aug 26 2004)) with ESMTPSA id <0JY8003NRVADKV@email.boulder.noaa.gov> for user@commons.apache.org; Mon, 24 Mar 2008 17:01:44 +0000 (GMT) Date: Mon, 24 Mar 2008 11:01:25 -0600 From: Ken Tanaka Subject: Re: [vfs] SFTP program not exiting - solution In-reply-to: <274ac2c109.2c109274ac@noaa.gov> To: Jakarta Commons Users List Message-id: <47E7DE65.3090207@noaa.gov> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Thunderbird 1.5.0.12 (X11/20080213) References: <274ac2c109.2c109274ac@noaa.gov> X-Virus-Checked: Checked by ClamAV on apache.org Ken.Tanaka@noaa.gov wrote: > I'm trying to automate the downloading of data from a remote SFTP > server using VFS. My program gets the files, but doesn't exit, it seems > to hang. It's not clear what cleanup steps I should be doing after > accessing files. I haven't found any VFS + SFTP examples or tutorials. > Sorry for the double posting, delivery errors and a failure of email filters made it look like the original post didn't go through. I did discover a solution though: one needs to cast the FileSystemManager to the DefaultFileSystemManager which then gives access to a no-argument close() method that does what I need. My release method from the sample code now works as: public void release() { ((DefaultFileSystemManager) this.fsManager).close(); } // release() See http://commons.apache.org/vfs/apidocs/org/apache/commons/vfs/impl/DefaultFileSystemManager.html#close() Thanks to a posting at http://osdir.com/ml/jakarta.commons.user/2003-11/msg00079.html by Morus Walter for cluing me in. -Ken --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org