public class EvernoteHtmlHelper extends EvernoteAsyncClient
Note as HTML instead of ENML. The easiest way to
create an instance is to call EvernoteClientFactory.getHtmlHelperDefault() for private and
linked notes or call EvernoteClientFactory.getHtmlHelperBusiness() for business notes.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
mAuthToken |
protected java.lang.String |
mHost |
protected OkHttpClient |
mHttpClient |
| Constructor and Description |
|---|
EvernoteHtmlHelper(OkHttpClient httpClient,
java.lang.String host,
java.lang.String authToken,
java.util.concurrent.ExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
createBaseUrl() |
Response |
downloadNote(java.lang.String noteGuid)
Makes a GET request to download the note content as HTML.
|
java.util.concurrent.Future<Response> |
downloadNoteAsync(java.lang.String noteGuid,
EvernoteCallback<Response> callback) |
Response |
fetchEvernoteUrl(java.lang.String url)
Fetches the URL with the current authentication token as cookie in the header.
|
java.lang.String |
parseBody(Response response) |
runOnUiThread, submitTaskprotected final OkHttpClient mHttpClient
protected final java.lang.String mHost
protected final java.lang.String mAuthToken
public EvernoteHtmlHelper(OkHttpClient httpClient,
java.lang.String host,
java.lang.String authToken,
java.util.concurrent.ExecutorService executorService)
httpClient - The HTTP client executing the GET call.host - The current host.authToken - Either the default authentication token or for the business authentication token
for business notes.executorService - The executor running the actions in the background.protected java.lang.String createBaseUrl()
public Response downloadNote(java.lang.String noteGuid)
throws java.io.IOException
parseBody(Response)
to get the note content from the returned response.noteGuid - The desired note.java.io.IOExceptionpublic java.util.concurrent.Future<Response> downloadNoteAsync(java.lang.String noteGuid,
EvernoteCallback<Response> callback)
throws java.io.IOException
java.io.IOExceptiondownloadNote(String)public java.lang.String parseBody(Response response)
throws java.io.IOException
response - The returned server response.200 as status code, otherwise null.java.io.IOExceptionpublic Response fetchEvernoteUrl(java.lang.String url)
throws java.io.IOException
url - The URL which should be opened.java.io.IOException