Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #301 from vainolo/master

Added Mendeley API
  • Loading branch information...
commit 7b4fe73ba2b958627d838704ee6a706abd266301 2 parents 422fb2b + ca470f8
@fernandezpablo85 authored
Showing with 43 additions and 0 deletions.
  1. +43 −0 src/main/java/org/scribe/builder/api/MendeleyApi.java
View
43 src/main/java/org/scribe/builder/api/MendeleyApi.java
@@ -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;
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.