DebugLog.log("JSCH command: " + command);
    public void open(SVNRepositoryImpl repository) throws SVNException {        ISVNAuthenticationManager authManager = repository                .getAuthenticationManager();        String realm = repository.getLocation().getProtocol() + "://"                + repository.getLocation().getHost() + ":"                + repository.getLocation().getPort();        String url = repository.getLocation().toCanonicalForm();        SVNSSHAuthentication authentication = (SVNSSHAuthentication) authManager.getFirstAuthentication(ISVNAuthenticationManager.SSH, realm, url);        SVNAuthenticationException lastException = null;        Session session = null;        while (authentication != null) {            try {                session = SVNJSchSession.getSession(repository.getLocation(), authentication);                if (session != null && !session.isConnected()) {                    session = null;                    continue;                }                lastException = null;                authManager.acknowledgeAuthentication(true, ISVNAuthenticationManager.SSH, realm, null, authentication);                repository.setExternalUserName(authentication.getUserName());                break;            } catch (SVNAuthenticationException e) {                if (session != null && session.isConnected()) {                    DebugLog.log("DISCONNECTING: " + session);                    session.disconnect();                    session = null;                }                lastException = e;                if (e.getMessage() != null  && e.getMessage().toLowerCase().indexOf("auth") >= 0) {                    authManager.acknowledgeAuthentication(false, ISVNAuthenticationManager.SSH, realm, e.getMessage(), authentication);                    authentication = (SVNSSHAuthentication) authManager.getNextAuthentication(ISVNAuthenticationManager.SSH, realm, url);                } else {                    throw e;                }            }        }        if (lastException != null || session == null) {            if (lastException != null) {                throw lastException;            }            throw new SVNAuthenticationException(                    "Can't establish SSH connection without credentials");        }        try {            int retry = 1;            while (true) {                myChannel = (ChannelExec) session.openChannel(CHANNEL_TYPE);                String command = SVNSERVE_COMMAND;                myChannel.setCommand(command);                myOutputStream = myChannel.getOutputStream();                myInputStream = myChannel.getInputStream();                DebugLog.log("JSCH command: " + command);                try {                    myChannel.connect();                } catch (Throwable e) {                    DebugLog.error(e);                    retry--;                    if (retry < 0) {                        throw new SVNException(e);                    }                    if (session.isConnected()) {                        session.disconnect();                    }                    continue;                }                break;            }        } catch (Throwable e) {            DebugLog.error(e);            close();            if (session.isConnected()) {                session.disconnect();            }            throw new SVNException("Failed to open SSH session: " + e.getMessage());        }        myInputStream = new FilterInputStream(myInputStream) {            public void close() {            }        };        myOutputStream = new FilterOutputStream(myOutputStream) {            public void close() {            }        };    }