本文整理汇总了Java中com.evernote.edam.error.EDAMNotFoundException类的典型用法代码示例。如果您正苦于以下问题:Java EDAMNotFoundException类的具体用法?Java EDAMNotFoundException怎么用?Java EDAMNotFoundException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EDAMNotFoundException类属于com.evernote.edam.error包,在下文中一共展示了EDAMNotFoundException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getLinkedHtmlHelper
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* Use this method, if you want to download a linked note as HTML.
*
* @param linkedNotebook The referenced {@link LinkedNotebook}. Its GUID and share key must not be
* {@code null}.
* @return An async wrapper to load a note as HTML from the Evernote service.
*/
public EvernoteHtmlHelper getLinkedHtmlHelper(@NonNull LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
String key = linkedNotebook.getGuid();
EvernoteHtmlHelper htmlHelper = mLinkedHtmlHelper.get(key);
if (htmlHelper == null) {
String url = linkedNotebook.getNoteStoreUrl();
EvernoteNoteStoreClient client = getNoteStoreClient(url, EvernotePreconditions.checkNotEmpty(mEvernoteSession.getAuthToken()));
AuthenticationResult authenticationResult = client.authenticateToSharedNotebook(linkedNotebook.getShareKey());
htmlHelper = createHtmlHelper(authenticationResult.getAuthenticationToken());
mLinkedHtmlHelper.put(key, htmlHelper);
}
return htmlHelper;
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:25,代码来源:EvernoteClientFactory.java
示例2: createBusinessNotebook
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* @param notebook The new business notebook.
* @param defaultClient The note store client, which references the user's note store.
* @return The new created {@link LinkedNotebook}, which has an business ID.
*/
public LinkedNotebook createBusinessNotebook(@NonNull Notebook notebook, @NonNull EvernoteNoteStoreClient defaultClient)
throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
Notebook originalNotebook = mClient.createNotebook(notebook);
List<SharedNotebook> sharedNotebooks = originalNotebook.getSharedNotebooks();
SharedNotebook sharedNotebook = sharedNotebooks.get(0);
LinkedNotebook linkedNotebook = new LinkedNotebook();
linkedNotebook.setShareKey(sharedNotebook.getShareKey());
linkedNotebook.setShareName(originalNotebook.getName());
linkedNotebook.setUsername(mBusinessUserName);
linkedNotebook.setShardId(mBusinessUserShardId);
return defaultClient.createLinkedNotebook(linkedNotebook);
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:22,代码来源:EvernoteBusinessNotebookHelper.java
示例3: findAllNotes
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
protected List<NotesMetadataList> findAllNotes(Search search, EvernoteNoteStoreClient client, NoteFilter filter) throws Exception {
List<NotesMetadataList> result = new ArrayList<>();
final int maxNotes = search.getMaxNotes();
int offset = search.getOffset();
int remaining = maxNotes - offset;
while (remaining > 0) {
try {
NotesMetadataList notesMetadata = client.findNotesMetadata(filter, offset, maxNotes, search.getResultSpec());
remaining = notesMetadata.getTotalNotes() - (notesMetadata.getStartIndex() + notesMetadata.getNotesSize());
result.add(notesMetadata);
} catch (EDAMUserException | EDAMSystemException | TException | EDAMNotFoundException e) {
maybeRethrow(search, e);
remaining -= search.getPageSize();
}
offset += search.getPageSize();
}
return result;
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:25,代码来源:EvernoteSearchHelper.java
示例4: loadNotebook
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* If this note is linked, then it loads the corresponding notebook for the linked notebook. Use
* {@link #loadLinkedNotebook()} to get the linked notebook.
*
* @return The note's notebook from server.
* @see #isLinked()
* @see EvernoteLinkedNotebookHelper#getCorrespondingNotebook()
*/
public Notebook loadNotebook() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (mNotebookGuid == null) {
return null;
}
if (mLinked) {
LinkedNotebook linkedNotebook = NoteRefHelper.getLinkedNotebook(mNotebookGuid);
return NoteRefHelper.getSession().getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook).getCorrespondingNotebook();
}
EvernoteNoteStoreClient noteStore = NoteRefHelper.getNoteStore(this);
if (noteStore == null) {
return null;
}
return noteStore.getNotebook(mNotebookGuid);
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:26,代码来源:NoteRef.java
示例5: loadLinkedNotebook
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* @return The linked notebook if this is a linked note.
* @see #isLinked()
*/
public LinkedNotebook loadLinkedNotebook() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (!mLinked) {
return null;
}
EvernoteNoteStoreClient noteStore = NoteRefHelper.getSession().getEvernoteClientFactory().getNoteStoreClient();
if (noteStore == null) {
return null;
}
List<LinkedNotebook> linkedNotebooks = noteStore.listLinkedNotebooks();
for (LinkedNotebook linkedNotebook : linkedNotebooks) {
if (linkedNotebook.getGuid().equals(mNotebookGuid)) {
return linkedNotebook;
}
}
return null;
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:24,代码来源:NoteRef.java
示例6: handleJobErr
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
public static IStatus handleJobErr(final Throwable e, final EeClipper clipper, final ENNote args, final Shell shell) {
if (e instanceof EDAMNotFoundException) {
if (args != null) {
return new EDAMNotFoundHandler(EncryptionUtil.decrypt(IDialogSettingsUtil.get(Constants.PLUGIN_SETTINGS_KEY_TOKEN))).fixNotFoundException((EDAMNotFoundException) e, args);
}
} else if (e instanceof EDAMUserException) {
return new EDAMUserExceptionHandler().handleRuntime(shell, (EDAMUserException) e, clipper);
} else if (e instanceof OutOfDateException) {
return LogUtil.error(Messages.bind(Messages.Plugin_OutOfDate, EemoryPlugin.getVersion()));
} else if (e instanceof TTransportException) {
if (clipper != null) {
clipper.setInvalid();
}
} else if (e instanceof NoDataFoundException) {
return LogUtil.warning(ExceptionUtils.getRootCauseMessage(e));
}
return LogUtil.error(e);
}
开发者ID:LTTPP,项目名称:Eemory,代码行数:19,代码来源:ThrowableHandler.java
示例7: create
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
private void create(final ENNote args) throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException, ParserConfigurationException, SAXException, IOException {
Note note = new Note();
note.setTitle(StringUtils.abbreviate(args.getName(), EDAMLimits.EDAM_NOTE_TITLE_LEN_MAX));
if (StringUtils.isNotBlank(args.getNotebook().getGuid())) {
note.setNotebookGuid(args.getNotebook().getGuid());
}
ENML enml = new ENML();
enml.setTabWidth(args.getTabWidth());
enml.addComment(args.getComments());
enml.addContent(args.getContent());
note.setContent(enml.get());
for (String tagName : args.getTags()) {
tagName = tagName.trim();
if (StringUtils.isNotBlank(tagName)) {
note.addToTagNames(tagName);
}
}
getNoteStoreClient(args).createNote(note);
}
开发者ID:LTTPP,项目名称:Eemory,代码行数:24,代码来源:NoteOpsTextImpl.java
示例8: listNotebooks
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* return a user's all notebooks(including linked notebooks).
*
* @return The user's notebooks.
*/
@Override
public Map<String, ENObject> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
List<Notebook> notebooks = factory.getNoteStoreClient().listNotebooks();
List<LinkedNotebook> linkedNotebooks = factory.getNoteStoreClient().listLinkedNotebooks();
Map<String, ENObject> map = MapUtil.map();
for (Notebook n : notebooks) {
map.put(n.getName(), ENObjectImpl.forNameAndGuid(n.getName(), n.getGuid()));
}
for (LinkedNotebook linkedNotebook : linkedNotebooks) { // LinkedNotebook must be serializable
NoteStoreClient linkedNoteStore = factory.getLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = linkedNoteStore.getSharedNotebookByAuth();
if (map.containsKey(linkedNotebook.getShareName())) {
map.put(linkedNotebook.getShareName() + ConstantsUtil.LEFT_PARENTHESIS + linkedNotebook.getUsername() + ConstantsUtil.COLON + sharedNotebook.getNotebookGuid() + ConstantsUtil.RIGHT_PARENTHESIS, ENObjectImpl.forValues(linkedNotebook.getShareName(), sharedNotebook.getNotebookGuid(), ENObjectType.LINKED, linkedNotebook));
} else {
map.put(linkedNotebook.getShareName(), ENObjectImpl.forValues(linkedNotebook.getShareName(), sharedNotebook.getNotebookGuid(), ENObjectType.LINKED, linkedNotebook));
}
}
return map;
}
开发者ID:LTTPP,项目名称:Eemory,代码行数:29,代码来源:EeClipperImpl.java
示例9: testIsEdamException
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
@Test
public void testIsEdamException() {
EvernoteException ex = new EvernoteException("", new EDAMUserException());
assertTrue(ex.isEDAMException());
ex = new EvernoteException("", new EDAMSystemException());
assertTrue(ex.isEDAMException());
ex = new EvernoteException("", new EDAMNotFoundException());
assertTrue(ex.isEDAMException());
ex = new EvernoteException("", new TException());
assertFalse(ex.isEDAMException());
ex = new EvernoteException("", new RuntimeException());
assertFalse(ex.isEDAMException());
}
开发者ID:ttddyy,项目名称:spring-social-evernote,代码行数:19,代码来源:EvernoteExceptionTest.java
示例10: connect
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
private void connect() throws TException, EDAMSystemException, EDAMUserException, EDAMNotFoundException {
if (noteStore == null) {
Stopwatch watch = Stopwatch.createStarted();
String userStoreUrl = "https://www.evernote.com/edam/user";
THttpClient userStoreHttpClient = new THttpClient(userStoreUrl);
TBinaryProtocol userStoreProtocol = new TBinaryProtocol(userStoreHttpClient);
userStore = new UserStore.Client(userStoreProtocol, userStoreProtocol);
String user = MARS_IMAGES.getMission().getUser();
userInfo = userStore.getPublicUserInfo(user);
uriPrefix = userInfo.getWebApiUrlPrefix();
String noteStoreUrl = userInfo.getNoteStoreUrl();
THttpClient noteStoreHttpClient = new THttpClient(noteStoreUrl);
noteStoreHttpClient.setConnectTimeout(TIMEOUT);
TBinaryProtocol noteStoreProtocol = new TBinaryProtocol(noteStoreHttpClient);
noteStore = new NoteStore.Client(noteStoreProtocol, noteStoreProtocol);
Log.d("evernote connect", "Time to connect to Evernote: " + watch.elapsed(TimeUnit.MILLISECONDS) + " ms");
}
}
开发者ID:OpsLabJPL,项目名称:MarsImagesAndroid,代码行数:19,代码来源:EvernoteMars.java
示例11: getEvernoteHtmlHelper
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
protected EvernoteHtmlHelper getEvernoteHtmlHelper() throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
if (mEvernoteHtmlHelper == null) {
EvernoteClientFactory clientFactory = EvernoteSession.getInstance().getEvernoteClientFactory();
if (mNoteRef.isLinked()) {
mEvernoteHtmlHelper = clientFactory.getLinkedHtmlHelper(mNoteRef.loadLinkedNotebook());
} else {
mEvernoteHtmlHelper = clientFactory.getHtmlHelperDefault();
}
}
return mEvernoteHtmlHelper;
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:14,代码来源:ViewHtmlActivity.java
示例12: createNote
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
protected Note createNote(Note note) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (mNotebook == null && mLinkedNotebook != null) {
EvernoteLinkedNotebookHelper linkedNotebookHelper = EvernoteSession.getInstance().getEvernoteClientFactory().getLinkedNotebookHelper(mLinkedNotebook);
return linkedNotebookHelper.createNoteInLinkedNotebook(note);
} else {
EvernoteNoteStoreClient noteStoreClient = EvernoteSession.getInstance().getEvernoteClientFactory().getNoteStoreClient();
return noteStoreClient.createNote(note);
}
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:11,代码来源:CreateNewNoteTask.java
示例13: deleteLinkedNotebook
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* @param defaultClient The note store client, which references the user's note store.
* @return A flag indicating if the action was successful.
* @see EvernoteNoteStoreClient#expungeLinkedNotebook(String)
*/
public int deleteLinkedNotebook(@NonNull EvernoteNoteStoreClient defaultClient) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
List<Long> sharedNotebookIds = new ArrayList<>();
sharedNotebookIds.add(sharedNotebook.getId());
mClient.expungeSharedNotebooks(sharedNotebookIds);
return defaultClient.expungeLinkedNotebook(mLinkedNotebook.getGuid());
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:15,代码来源:EvernoteLinkedNotebookHelper.java
示例14: getLinkedNotebookHelper
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* Returns an async wrapper providing several helper methods for this {@link LinkedNotebook}. With
* {@link EvernoteLinkedNotebookHelper#getClient()} you can get access to the underlying {@link EvernoteNoteStoreClient},
* which references the {@link LinkedNotebook}'s note store URL.
*
* @param linkedNotebook The referenced {@link LinkedNotebook}. Its GUID and share key must not be
* {@code null}.
* @return An async wrapper providing several helper methods.
*/
public synchronized EvernoteLinkedNotebookHelper getLinkedNotebookHelper(@NonNull LinkedNotebook linkedNotebook)
throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
String key = linkedNotebook.getGuid();
EvernoteLinkedNotebookHelper notebookHelper = mLinkedNotebookHelpers.get(key);
if (notebookHelper == null) {
notebookHelper = createLinkedNotebookHelper(linkedNotebook);
mLinkedNotebookHelpers.put(key, notebookHelper);
}
return notebookHelper;
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:22,代码来源:EvernoteClientFactory.java
示例15: listBusinessNotebooks
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* @param defaultClient The note store client, which references the user's note store.
* @return A list of {@link LinkedNotebook}s, which all have a business ID.
*/
public List<LinkedNotebook> listBusinessNotebooks(@NonNull EvernoteNoteStoreClient defaultClient) throws EDAMUserException,
EDAMSystemException, TException, EDAMNotFoundException {
List<LinkedNotebook> businessNotebooks = new ArrayList<>(defaultClient.listLinkedNotebooks());
Iterator<LinkedNotebook> iterator = businessNotebooks.iterator();
while (iterator.hasNext()) {
if (!isBusinessNotebook(iterator.next())) {
iterator.remove();
}
}
return businessNotebooks;
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:19,代码来源:EvernoteBusinessNotebookHelper.java
示例16: getNoteStore
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
public static EvernoteNoteStoreClient getNoteStore(NoteRef noteRef) throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
EvernoteSession session = getSession();
if (!noteRef.isLinked()) {
return getSession().getEvernoteClientFactory().getNoteStoreClient();
}
LinkedNotebook linkedNotebook = getLinkedNotebook(noteRef.getNotebookGuid());
if (linkedNotebook == null) {
return null;
}
return session.getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook).getClient();
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:15,代码来源:NoteRefHelper.java
示例17: getLinkedNotebook
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
public static LinkedNotebook getLinkedNotebook(String notebookGuid) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (LINKED_NOTEBOOK_CACHE.containsKey(notebookGuid)) {
return LINKED_NOTEBOOK_CACHE.get(notebookGuid);
}
List<LinkedNotebook> linkedNotebooks = getSession().getEvernoteClientFactory().getNoteStoreClient().listLinkedNotebooks();
for (LinkedNotebook linkedNotebook : linkedNotebooks) {
LINKED_NOTEBOOK_CACHE.put(linkedNotebook.getGuid(), linkedNotebook);
}
return LINKED_NOTEBOOK_CACHE.get(notebookGuid);
}
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:13,代码来源:NoteRefHelper.java
示例18: listNotebooks
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* Helper method to list business notebooks synchronously
*
* @return
* @throws EDAMUserException
* @throws EDAMSystemException
* @throws TException
* @throws EDAMNotFoundException
*/
@Override
public List<LinkedNotebook> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
List<LinkedNotebook> linkedNotebooks = new ArrayList<LinkedNotebook>();
for (LinkedNotebook notebook : super.listNotebooks()) {
if (notebook.isSetBusinessId()) {
linkedNotebooks.add(notebook);
}
}
return linkedNotebooks;
}
开发者ID:duanze,项目名称:PureNote,代码行数:21,代码来源:AsyncBusinessNoteStoreClient.java
示例19: deleteNotebook
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* Providing a LinkedNotebook referencing a Business notebook, perform a delete
*
* Synchronous call
*
* @return guid of notebook deleted
*/
@Override
public int deleteNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
AsyncLinkedNoteStoreClient sharedNoteStore = getClientFactory().createLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = sharedNoteStore.getAsyncClient().getClient().getSharedNotebookByAuth(sharedNoteStore.getAuthenticationToken());
Long[] ids = {sharedNotebook.getId()};
getAsyncClient().getClient().expungeSharedNotebooks(getAuthenticationToken(), Arrays.asList(ids));
return getAsyncPersonalClient().getClient().expungeLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook.getGuid());
}
开发者ID:duanze,项目名称:PureNote,代码行数:18,代码来源:AsyncBusinessNoteStoreClient.java
示例20: getCorrespondingNotebook
import com.evernote.edam.error.EDAMNotFoundException; //导入依赖的package包/类
/**
* Will return the {@link Notebook} associated with the {@link LinkedNotebook} from the business account
*
* Synchronous call
*
* @param linkedNotebook
*/
@Override
public Notebook getCorrespondingNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
//Get LinkedStore for auth information
AsyncLinkedNoteStoreClient sharedNoteStore = getClientFactory().createLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = sharedNoteStore.getAsyncClient().getClient().getSharedNotebookByAuth(sharedNoteStore.getAuthenticationToken());
return getAsyncClient().getClient().getNotebook(getAuthenticationToken(), sharedNotebook.getNotebookGuid());
}
开发者ID:duanze,项目名称:PureNote,代码行数:16,代码来源:AsyncBusinessNoteStoreClient.java
注:本文中的com.evernote.edam.error.EDAMNotFoundException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论