public void execute( Sftp sftp ) throws JSchException, IOException {
        logger.debug( "executing sftp command on {}", sessionManager );
        ChannelSftp channelSftp = null;
        try {
            channelSftp = (ChannelSftp) sessionManager.getSession()
                    .openChannel( CHANNEL_SFTP );
            channelSftp.connect();
            sftp.run( channelSftp );
        }
        finally {
            if ( channelSftp != null ) {
                channelSftp.disconnect();
            }
        }
    }
public void execute ( Sftp sftp ) throws JSchException , IOException { logger . debug ( "executing sftp command on {}" , sessionManager ) ; ChannelSftp channelSftp = null ; try { channelSftp = ( ChannelSftp ) sessionManager . getSession ( ) . openChannel ( CHANNEL_SFTP ) ; channelSftp . connect ( ) ; sftp . run ( channelSftp ) ; } finally { if ( channelSftp != null ) { channelSftp . disconnect ( ) ; } } }
Executes the <code>sftp</code> callback providing it an open
{@link ChannelSftp}. Sftp callback implementations should <i>NOT</i>
close the channel.

@param sftp A callback
@throws JSchException
If ssh execution fails
@throws IOException
If unable to read the result data