예제 #1
0
파일: URLParser.go 프로젝트: hinike/gosips
/** Parse and return a structure for a generic URL.
 * Note that non SIP URLs are just stored as a string (not parsed).
 *@return URI is a URL structure for a SIP url.
 *@throws ParsException if there was a problem parsing.
 */
func (this *URLParser) UriReference() (url address.URI, ParseException error) {
	var retval address.URI
	vect, _ := this.GetLexer().PeekNextTokenK(2)
	t1 := vect[0]
	t2 := vect[1]

	if t1.GetTokenType() == TokenTypes_SIP {
		if t2.GetTokenType() == ':' {
			if retval, ParseException = this.SipURL(); ParseException != nil {
				return nil, ParseException
			}
		} else {
			return nil, this.CreateParseException("Expecting ':'")
		}
	} else if t1.GetTokenType() == TokenTypes_TEL {
		if t2.GetTokenType() == ':' {
			if retval, ParseException = this.TelURL(); ParseException != nil {
				return nil, ParseException
			}
		} else {
			return nil, this.CreateParseException("Expecting ':'")
		}
	} else {
		urlString := this.UricString()
		retval = address.NewURIImpl(urlString)
	}

	return retval, nil
}
예제 #2
0
/**
 * Returns the URI value of this WWWAuthenicateHeader,
 * for example DigestURI.
 *
 * @return the URI representing the URI information, null if value is
 * not Set.
 *
 */
func (this *Authentication) GetURI() address.URI {
	url := this.GetParameter(ParameterNames_URI)
	return address.NewURIImpl(url)
}