Skip to content

Commit 2c7464e

Browse files
committed
Merge commit '577278872f1c5a7826f21295a838f5fa5e37d56c'; commit '39a8ab9eb200e7c8b819f3d5525f437133287d9c'; commit '0969036991db5d4efe6b0dad447dd149850db134' into newapis
2 parents 3add79b + 0969036 commit 2c7464e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package org.scribe.builder.api;
2+
3+
import org.scribe.builder.api.*;
4+
import org.scribe.model.*;
5+
6+
public class RdioApi extends DefaultApi10a
7+
{
8+
private static final String AUTHORIZE_URL = "https://www.rdio.com/oauth/authorize?oauth_token=%s";
9+
private static final String REQUEST_TOKEN_RESOURCE = "api.rdio.com/oauth/request_token";
10+
private static final String ACCESS_TOKEN_RESOURCE = "api.rdio.com/oauth/access_token";
11+
12+
@Override
13+
public String getAccessTokenEndpoint()
14+
{
15+
return "http://" + ACCESS_TOKEN_RESOURCE;
16+
}
17+
18+
@Override
19+
public String getRequestTokenEndpoint()
20+
{
21+
return "http://" + REQUEST_TOKEN_RESOURCE;
22+
}
23+
24+
@Override
25+
public String getAuthorizationUrl(Token requestToken)
26+
{
27+
return String.format(AUTHORIZE_URL, requestToken.getToken());
28+
}
29+
30+
public static class SSL extends RdioApi
31+
{
32+
@Override
33+
public String getAccessTokenEndpoint()
34+
{
35+
return "https://" + ACCESS_TOKEN_RESOURCE;
36+
}
37+
38+
@Override
39+
public String getRequestTokenEndpoint()
40+
{
41+
return "https://" + REQUEST_TOKEN_RESOURCE;
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)