commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Tanaka <Ken.Tan...@noaa.gov>
Subject Re: [vfs] SFTP program not exiting - solution
Date Mon, 24 Mar 2008 17:01:25 GMT


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


Mime
View raw message