host = tokens[0];
if ( tokens[1].indexOf( '/' ) == -1 )
{
throw new ScmRepositoryException(
"Invalid SCM URL: The url has to be on the form: " + STARTEAM_URL_FORMAT );
}
int at = tokens[1].indexOf( '/' );
port = new Integer( tokens[1].substring( 0, at ) ).intValue();
path = tokens[1].substring( at );
}
else
{
throw new ScmRepositoryException(
"Invalid SCM URL: The url has to be on the form: " + STARTEAM_URL_FORMAT );
}
try
{
return new StarteamScmProviderRepository( user, password, host, port, path );
}
catch ( Exception e )
{
throw new ScmRepositoryException(
"Invalid SCM URL: The url has to be on the form: " + STARTEAM_URL_FORMAT );
}
}