Java Code Examples for org.scribe.utils.Preconditions#checkValidUrl()

The following examples show how to use org.scribe.utils.Preconditions#checkValidUrl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HubicApi.java    From swift-explorer with Apache License 2.0 6 votes vote down vote up
@Override
public String getAuthorizationUrl(OAuthConfig config) 
{
	Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback.") ;
	if (config.hasScope()) 
	{
		return String.format(SCOPED_AUTHORIZE_URL, config.getApiKey(),
				OAuthEncoder.encode(config.getCallback()),
				OAuthEncoder.encode(config.getScope()));
	} 
	else 
	{
		return String.format(AUTHORIZE_URL, config.getApiKey(),
				OAuthEncoder.encode(config.getCallback()));
	}
}
 
Example 2
Source File: SliApi.java    From secure-data-service with Apache License 2.0 5 votes vote down vote up
@Override
public String getAuthorizationUrl(OAuthConfig config) {
    Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback.");

    return String.format(REQUEST_TOKEN_FRAGMENT, apiUrl.toString(), config.getApiKey(),
            OAuthEncoder.encode(config.getCallback()));
}
 
Example 3
Source File: SliApi.java    From secure-data-service with Apache License 2.0 4 votes vote down vote up
@Override
public String getAuthorizationUrl(OAuthConfig config) {
    Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback.");
    
    return String.format(authorizeUrl, config.getApiKey(), OAuthEncoder.encode(config.getCallback()));
}