• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EDAMUserException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.evernote.edam.error.EDAMUserException的典型用法代码示例。如果您正苦于以下问题:Java EDAMUserException类的具体用法?Java EDAMUserException怎么用?Java EDAMUserException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EDAMUserException类属于com.evernote.edam.error包,在下文中一共展示了EDAMUserException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getLinkedHtmlHelper

import com.evernote.edam.error.EDAMUserException; //导入依赖的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.EDAMUserException; //导入依赖的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: loadLinkedNotebook

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例4: loadNotebook

import com.evernote.edam.error.EDAMUserException; //导入依赖的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: findAllNotes

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例6: getEvernoteHtmlHelper

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例7: createNote

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例8: checkException

import com.evernote.edam.error.EDAMUserException; //导入依赖的package包/类
protected static void checkException(@NonNull final Exception e, @Nullable final Activity activity) {
    if (e instanceof EDAMUserException) {
        switch (((EDAMUserException) e).getErrorCode()) {
            case AUTH_EXPIRED:
                if (activity != null) {
                    Util.logout(activity);
                }
                break;

            case PERMISSION_DENIED:
                if (activity != null) {
                    activity.runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            View view = activity.findViewById(android.R.id.content);
                            CoordinatorLayout fabCoordinator = ViewUtil.findFabCoordinator(view, R.id.coordinatorLayout);
                            if (fabCoordinator != null) {
                                view = fabCoordinator;
                            }

                            final Snackbar snackbar = Snackbar.make(view, ((EDAMUserException) e).getErrorCode().toString(), Snackbar.LENGTH_INDEFINITE);
                            snackbar.setActionTextColor(activity.getResources().getColor(R.color.tb_bg))
                                    .setAction(android.R.string.ok, new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    snackbar.dismiss();
                                }
                            }).show();
                        }
                    });
                }
                break;
        }
    }
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:36,代码来源:BaseTask.java


示例9: deleteLinkedNotebook

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例10: getLinkedNotebookHelper

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例11: createBusinessNotebookHelper

import com.evernote.edam.error.EDAMUserException; //导入依赖的package包/类
protected EvernoteBusinessNotebookHelper createBusinessNotebookHelper() throws TException, EDAMUserException, EDAMSystemException {
    authenticateToBusiness();

    EvernoteNoteStoreClient client = getNoteStoreClient(mBusinessAuthenticationResult.getNoteStoreUrl(), mBusinessAuthenticationResult.getAuthenticationToken());

    User businessUser = mBusinessAuthenticationResult.getUser();
    return new EvernoteBusinessNotebookHelper(client, mExecutorService, businessUser.getUsername(), businessUser.getShardId());
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:9,代码来源:EvernoteClientFactory.java


示例12: getHtmlHelperBusiness

import com.evernote.edam.error.EDAMUserException; //导入依赖的package包/类
/**
 * Use this method, if you want to download a business note as HTML.
 *
 * @return An async wrapper to load a business note as HTML from the Evernote service.
 */
public synchronized EvernoteHtmlHelper getHtmlHelperBusiness() throws TException, EDAMUserException, EDAMSystemException {
    if (mHtmlHelperBusiness == null) {
        authenticateToBusiness();
        mHtmlHelperBusiness = createHtmlHelper(mBusinessAuthenticationResult.getAuthenticationToken());
    }
    return mHtmlHelperBusiness;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:13,代码来源:EvernoteClientFactory.java


示例13: listBusinessNotebooks

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例14: getNoteStore

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例15: getLinkedNotebook

import com.evernote.edam.error.EDAMUserException; //导入依赖的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


示例16: createNoteInLinkedNotebook

import com.evernote.edam.error.EDAMUserException; //导入依赖的package包/类
/**
 * @param note The new note.
 * @return The new created note from the server.
 */
public Note createNoteInLinkedNotebook(@NonNull Note note) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
    SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
    note.setNotebookGuid(sharedNotebook.getNotebookGuid());
    return mClient.createNote(note);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:10,代码来源:EvernoteLinkedNotebookHelper.java


示例17: getCorrespondingNotebook

import com.evernote.edam.error.EDAMUserException; //导入依赖的package包/类
/**
 * @return The notebook for this linked notebook.
 */
public Notebook getCorrespondingNotebook() throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
    SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
    return mClient.getNotebook(sharedNotebook.getNotebookGuid());
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:8,代码来源:EvernoteLinkedNotebookHelper.java


示例18: isNotebookWritable

import com.evernote.edam.error.EDAMUserException; //导入依赖的package包/类
/**
 * @return {@code true} if this linked notebook is writable.
 */
public boolean isNotebookWritable() throws EDAMUserException, TException, EDAMSystemException, EDAMNotFoundException {
    Notebook notebook = getCorrespondingNotebook();
    return !notebook.getRestrictions().isNoCreateNotes();
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:8,代码来源:EvernoteLinkedNotebookHelper.java


示例19: authenticateToBusiness

import com.evernote.edam.error.EDAMUserException; //导入依赖的package包/类
protected final void authenticateToBusiness() throws TException, EDAMUserException, EDAMSystemException {
    if (isBusinessAuthExpired()) {
        mBusinessAuthenticationResult = getUserStoreClient().authenticateToBusiness();
    }
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:6,代码来源:EvernoteClientFactory.java


示例20: getSyncState

import com.evernote.edam.error.EDAMUserException; //导入依赖的package包/类
public SyncState getSyncState() throws EDAMUserException, EDAMSystemException, TException {
    return mClient.getSyncState(mAuthenticationToken);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:4,代码来源:EvernoteNoteStoreClient.java



注:本文中的com.evernote.edam.error.EDAMUserException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HttpRequestFactory类代码示例发布时间:2022-05-22
下一篇:
Java ISession类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap