close();
close(repository);
    public void open(SVNRepositoryImpl repository) throws SVNException {        // 1. expand tunnel spec (when env. is used).        String expandedTunnel = expandTunnelSpec(myName, myTunnelSpec);        // 2. create tunnel command using repo URL.         String host = repository.getLocation().getHost();        String username = System.getProperty("user.name");        if (repository.getLocation().getUserInfo() != null) {            username = repository.getLocation().getUserInfo();            host = username + "@" + host;        }        expandedTunnel = MessageFormat.format(TUNNEL_COMMAND, new String[] {expandedTunnel, host});        // 3. get and append --tunnel-user if needed.        if (repository.getAuthenticationManager() != null) {            SVNAuthentication auth = repository.getAuthenticationManager().getFirstAuthentication(ISVNAuthenticationManager.USERNAME, host, repository.getLocation());            if (auth == null) {                SVNErrorManager.cancel("Authentication cancelled");            }            repository.getAuthenticationManager().acknowledgeAuthentication(true, ISVNAuthenticationManager.USERNAME, host, null, auth);            expandedTunnel += " --tunnel-user " + auth.getUserName();        }                 // 4. launch process.               try {            myProcess = Runtime.getRuntime().exec(expandedTunnel);            myInputStream = SVNDebugLog.createLogStream(myProcess.getInputStream());             myOutputStream = SVNDebugLog.createLogStream(myProcess.getOutputStream());                         new StreamGobbler(myProcess.getErrorStream());        } catch (IOException e) {            try {                close();            } catch (SVNException inner) {            }            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.EXTERNAL_PROGRAM, "Cannot create tunnel: ''{0}''", e.getMessage());                        SVNErrorManager.error(err, e);        }    }