class SFTPSession extends Session<SSHClient> {

    @Override
    public SSHClient connect(final Proxy proxy, final HostKeyCallback key, final LoginCallback prompt) throws BackgroundException {
        try {
            final DefaultConfig configuration = new DefaultConfig();
            if("zlib".equals(preferences.getProperty("ssh.compression"))) {
                configuration.setCompressionFactories(Arrays.asList(
                    new DelayedZlibCompression.Factory(),
                    new ZlibCompression.Factory(),
                    new NoneCompression.Factory()));
            }
            else {
                configuration.setCompressionFactories(Collections.singletonList(new NoneCompression.Factory()));
            }
            configuration.setVersion(new PreferencesUseragentProvider().get());
            final KeepAliveProvider heartbeat;
            if(preferences.getProperty("ssh.heartbeat.provider").equals("keep-alive")) {
                heartbeat = KeepAliveProvider.KEEP_ALIVE;
            }
            else {
                heartbeat = KeepAliveProvider.HEARTBEAT;
            }
            configuration.setKeepAliveProvider(heartbeat);
            return this.connect(key, configuration);
        }
        catch(IOException e) {
            throw new SFTPExceptionMappingService().map(e);
        }
    }

    public  SFTPSession(final Host h, final X509TrustManager trust, final X509KeyManager key);

}