private void Init(Uri uri) {
m_fragment = uri.Fragment;
m_query = uri.Query;
m_host = uri.Host;
m_path = uri.AbsolutePath;
m_port = uri.Port;
m_scheme = uri.Scheme;
m_schemeDelimiter = uri.HasAuthority? Uri.SchemeDelimiter: ":";
string userInfo = uri.UserInfo;
if (!ValidationHelper.IsBlankString(userInfo)) {
int index = userInfo.IndexOf(':');
if (index != -1) {
m_password = userInfo.Substring(index + 1);
m_username = userInfo.Substring(0, index);
}
else {
m_username = userInfo;
}
}
SetFieldsFromUri(uri);
}