package org.scribe.builder.api;

import org.scribe.model.Token;

public class EvernoteApi extends DefaultApi10a
{
  private static final String AUTHORIZATION_URL = "https://www.evernote.com/OAuth.action?oauth_token=%s";

  @Override
	public String getRequestTokenEndpoint()
  {
    return "https://www.evernote.com/oauth";
  }

	@Override
	public String getAccessTokenEndpoint()
	{
	  return "https://www.evernote.com/oauth";
	}
	
	@Override
	public String getAuthorizationUrl(Token requestToken)
	{
	  return String.format(AUTHORIZATION_URL, requestToken.getToken());
	}

	public static class Sandbox extends EvernoteApi
	{
	  private static final String SANDBOX_URL = "https://sandbox.evernote.com";

	  @Override
	  public String getRequestTokenEndpoint()
	  {
	    return SANDBOX_URL + "/oauth";
	  }

	  @Override
	  public String getAccessTokenEndpoint()
	  {
      return SANDBOX_URL + "/oauth";
	  }

	  @Override
	  public String getAuthorizationUrl(Token requestToken)
	  {
	    return String.format(SANDBOX_URL + "/OAuth.action?oauth_token=%s", requestToken.getToken());
	  }
	}	
}

@@ -58,16 +58,107 @@
 Token;%0A%0A
+/**%0A * OAuth API for Evernote%0A *%0A * @author Pablo Fernandez%0A * @author Norbert Potocki%0A */%0A
 public c
@@ -309,33 +309,34 @@
 %22;%0A%0A  @Override%0A
-%09
+  
 public String ge
@@ -413,17 +413,18 @@
 %22;%0A  %7D%0A%0A
-%09
+  
 @Overrid
@@ -417,33 +417,34 @@
  %7D%0A%0A  @Override%0A
-%09
+  
 public String ge
@@ -466,20 +466,22 @@
 point()%0A
-%09%7B%0A%09
+  %7B%0A  
   return
@@ -519,14 +519,15 @@
 h%22;%0A
-%09%7D%0A%09%0A%09
+  %7D%0A%0A  
 @Ove
@@ -532,17 +532,18 @@
 verride%0A
-%09
+  
 public S
@@ -588,20 +588,22 @@
 tToken)%0A
-%09%7B%0A%09
+  %7B%0A  
   return
@@ -666,13 +666,15 @@
 ));%0A
-%09%7D%0A%0A%09
+  %7D%0A%0A  
 publ
@@ -721,12 +721,14 @@
 Api%0A
-%09%7B%0A%09
+  %7B%0A  
   pr
@@ -800,17 +800,18 @@
 .com%22;%0A%0A
-%09
+  
   @Overr
@@ -806,33 +806,34 @@
 %0A%0A    @Override%0A
-%09
+  
   public String 
@@ -858,22 +858,24 @@
 point()%0A
-%09
+  
   %7B%0A
-%09
+  
     retu
@@ -893,39 +893,41 @@
 URL + %22/oauth%22;%0A
-%09
+  
   %7D%0A%0A
-%09
+  
   @Override%0A%09  p
@@ -914,33 +914,34 @@
 %0A%0A    @Override%0A
-%09
+  
   public String 
@@ -965,17 +965,18 @@
 point()%0A
-%09
+  
   %7B%0A    
@@ -1012,15 +1012,17 @@
 h%22;%0A
-%09
+  
   %7D%0A%0A
-%09
+  
   @O
@@ -1029,17 +1029,18 @@
 verride%0A
-%09
+  
   public
@@ -1091,14 +1091,16 @@
 en)%0A
-%09
+ 
   
+ 
 %7B%0A
-%09
+  
     
@@ -1196,15 +1196,549 @@
 ));%0A
-%09
+  
   %7D%0A
-%09%7D%09
+  %7D%0A%0A  public static class Yinxiang extends EvernoteApi%0A  %7B%0A    private static final String SANDBOX_URL = %22https://app.yinxiang.com%22;%0A%0A    @Override%0A    public String getRequestTokenEndpoint()%0A    %7B%0A      return SANDBOX_URL + %22/oauth%22;%0A    %7D%0A%0A    @Override%0A    public String getAccessTokenEndpoint()%0A    %7B%0A      return SANDBOX_URL + %22/oauth%22;%0A    %7D%0A%0A    @Override%0A    public String getAuthorizationUrl(Token requestToken)%0A    %7B%0A      return String.format(SANDBOX_URL + %22/OAuth.action?oauth_token=%25s%22, requestToken.getToken());%0A    %7D%0A  %7D
 %0A%7D%0A

add Chinese Evernote (Yinxiang) endpoint