forked from scribejava/scribejava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scribejava#301 from vainolo/master
Added Mendeley API
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.scribe.builder.api; | ||
|
||
import org.scribe.model.*; | ||
|
||
/** | ||
* @author Arieh "Vainolo" Bibliowicz | ||
* @see http://apidocs.mendeley.com/home/authentication | ||
*/ | ||
public class MendeleyApi extends DefaultApi10a | ||
{ | ||
|
||
private static final String AUTHORIZATION_URL = "http://api.mendeley.com/oauth/authorize?oauth_token=%s"; | ||
|
||
@Override | ||
public String getRequestTokenEndpoint() | ||
{ | ||
return "http://api.mendeley.com/oauth/request_token/"; | ||
} | ||
|
||
@Override | ||
public String getAccessTokenEndpoint() | ||
{ | ||
return "http://api.mendeley.com/oauth/access_token/"; | ||
} | ||
|
||
@Override | ||
public String getAuthorizationUrl(Token requestToken) | ||
{ | ||
return String.format(AUTHORIZATION_URL, requestToken.getToken()); | ||
} | ||
|
||
@Override | ||
public Verb getAccessTokenVerb() | ||
{ | ||
return Verb.GET; | ||
} | ||
|
||
@Override | ||
public Verb getRequestTokenVerb() | ||
{ | ||
return Verb.GET; | ||
} | ||
} |