} else { this.host = hostportArray[0]; this.port = getDefaultPort(protocol);
    private void parseUrl(String svnUrl) throws MalformedURLException{        String parsed = svnUrl;        // SVNUrl have this format :        // scheme://host[:port]/path                // parse protocol        int i = parsed.indexOf("://");        if (i == -1)            throw new MalformedURLException("Invalid svn url :"+svnUrl);        protocol = parsed.substring(0,i).toLowerCase();        if ((!protocol.equalsIgnoreCase("http")) &&            (!protocol.equalsIgnoreCase("https")) &&            (!protocol.equalsIgnoreCase("file")) &&            (!protocol.equalsIgnoreCase("svn")) &&            (!protocol.equalsIgnoreCase("svn+ssh")) ) {            throw new MalformedURLException("Invalid svn url :"+svnUrl);        }        parsed = parsed.substring(i+3);		if (parsed.length() == 0) {			throw new MalformedURLException("Invalid svn url :"+svnUrl);		}        // parse host & port                i = parsed.indexOf("/");        if (i == -1) {            i = parsed.length();        }        String hostPort = parsed.substring(0,i).toLowerCase();        String[] hostportArray = StringUtils.split(hostPort,':');        if (hostportArray.length == 2) {            this.host = hostportArray[0];            try {                this.port = Integer.parseInt(hostportArray[1]);            } catch (NumberFormatException e) {                throw new MalformedURLException("Invalid svn url :"+svnUrl);            }        } else {            this.host = hostportArray[0];            this.port = getDefaultPort(protocol);        }                // parse path        if (i < parsed.length()) {            parsed = parsed.substring(i+1);        } else {            parsed = "";        }        segments = StringUtils.split(parsed,'/');    }