當前位置: 首頁>>代碼示例>>Java>>正文


Java BoxComment類代碼示例

本文整理匯總了Java中com.box.boxjavalibv2.dao.BoxComment的典型用法代碼示例。如果您正苦於以下問題:Java BoxComment類的具體用法?Java BoxComment怎麽用?Java BoxComment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BoxComment類屬於com.box.boxjavalibv2.dao包,在下文中一共展示了BoxComment類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testAddComment1

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
@Test
public void testAddComment1() throws Exception {
    final Map<String, Object> headers = new HashMap<String, Object>();
    // parameter type is String
    headers.put("CamelBox.commentedItemId", testFileId);
    // parameter type is com.box.boxjavalibv2.dao.IBoxType
    headers.put("CamelBox.commentedItemType", BoxResourceType.FILE);
    // parameter type is String
    headers.put("CamelBox.message", "Camel was here!");

    BoxComment result = requestBodyAndHeaders("direct://ADDCOMMENT_1", null, headers);
    assertNotNull("addComment result", result);
    LOG.debug("addComment: " + result);

    deleteComment(result.getId());
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:17,代碼來源:IBoxCommentsManagerIntegrationTest.java

示例2: testGetComment

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
@Test
    public void testGetComment() throws Exception {
        final BoxComment comment = addComment();
        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.commentId", comment.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
//            headers.put("CamelBox.defaultRequest", null);
            BoxComment result = requestBodyAndHeaders("direct://GETCOMMENT", null, headers);

            LOG.debug("getComment: " + result);
        } finally {
            deleteComment(comment.getId());
        }
    }
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:17,代碼來源:IBoxCommentsManagerIntegrationTest.java

示例3: testUpdateComment

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
@Test
public void testUpdateComment() throws Exception {
    final BoxComment comment = addComment();
    try {
        final Map<String, Object> headers = new HashMap<String, Object>();
        // parameter type is String
        headers.put("CamelBox.commentId", comment.getId());
        // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxCommentRequestObject
        final BoxCommentRequestObject requestObject =
                BoxCommentRequestObject.updateCommentRequestObject("Camel was here, again!");
        headers.put("CamelBox.commentRequest", requestObject);
        BoxComment result = requestBodyAndHeaders("direct://UPDATECOMMENT", null, headers);

        LOG.debug("updateComment: " + result);
    } finally {
        deleteComment(comment.getId());
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:19,代碼來源:IBoxCommentsManagerIntegrationTest.java

示例4: addComment

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
private BoxComment addComment() throws InterruptedException {
    final BoxCommentRequestObject requestObject =
            BoxCommentRequestObject.addCommentRequestObject(BoxResourceType.FILE, testFileId, "Camel was here!");

    BoxComment result = requestBody("direct://ADDCOMMENT", requestObject);
    assertNotNull("addComment result", result);
    Thread.sleep(2000);
    return result;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:10,代碼來源:IBoxCommentsManagerIntegrationTest.java

示例5: getComments

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
/**
 * Get comments from a collection.
 * 
 * @param collection
 *            collection
 * @return comments
 */
public static List<BoxComment> getComments(BoxCollection collection) {
    List<BoxComment> comments = new ArrayList<BoxComment>();
    List<BoxTypedObject> list = collection.getEntries();
    for (BoxTypedObject object : list) {
        if (object instanceof BoxComment) {
            comments.add((BoxComment) object);
        }
    }
    return comments;
}
 
開發者ID:mobilesystems,項目名稱:box-java-sdk-v2,代碼行數:18,代碼來源:BoxCommentsManager.java

示例6: getClass

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
@Override
@SuppressWarnings("rawtypes")
public Class getClass(BoxResourceType type) {
    switch (type) {
        case FILE:
            return BoxFile.class;
        case PREVIEW:
            return BoxPreview.class;
        case FOLDER:
            return BoxFolder.class;
        case WEB_LINK:
            return BoxWebLink.class;
        case USER:
            return BoxUser.class;
        case FILE_VERSION:
            return BoxFileVersion.class;
        case ITEM:
            return BoxItem.class;
        case COMMENT:
            return BoxComment.class;
        case COLLABORATION:
            return BoxCollaboration.class;
        case EMAIL_ALIAS:
            return BoxEmailAlias.class;
        case OAUTH_DATA:
            return BoxOAuthToken.class;
        case EVENT:
            return BoxEvent.class;
        case REALTIME_SERVER:
            return BoxRealTimeServer.class;
        case LOCK:
            return BoxLock.class;
        case ERROR:
            return BoxServerError.class;
        case ITEMS:
        case FILES:
        case USERS:
        case COMMENTS:
        case FILE_VERSIONS:
        case COLLABORATIONS:
        case EMAIL_ALIASES:
            return BoxCollection.class;
        default:
            return BoxTypedObject.class;
    }
}
 
開發者ID:mobilesystems,項目名稱:box-java-sdk-v2,代碼行數:47,代碼來源:BoxResourceHub.java

示例7: addComment

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
/**
 * Add a comment to an item.
 * 
 * @param requestObject
 *            comment request object.
 * @throws BoxRestException
 *             exception
 * @throws BoxServerException
 *             exception
 * @throws AuthFatalFailureException
 *             exception indicating authentication totally failed
 */
public BoxComment addComment(final BoxCommentRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException {
    CreateCommentRequest request = new CreateCommentRequest(getConfig(), getObjectMapper(), requestObject);
    return (BoxComment) getResponseAndParseAndTryCast(request, BoxResourceType.COMMENT, getObjectMapper());
}
 
開發者ID:mobilesystems,項目名稱:box-java-sdk-v2,代碼行數:17,代碼來源:BoxCommentsManager.java

示例8: getComment

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
/**
 * Get a comment, given a comment id.
 * 
 * @param commentId
 *            id of the comment
 * @param requestObject
 *            object that goes into request.
 * @return comment
 * @throws BoxRestException
 *             exception
 * @throws BoxServerException
 *             exception
 * @throws AuthFatalFailureException
 *             exception indicating authentication totally failed
 */
public BoxComment getComment(final String commentId, BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException,
    AuthFatalFailureException {
    GetCommentRequest request = new GetCommentRequest(getConfig(), getObjectMapper(), commentId, requestObject);
    return (BoxComment) getResponseAndParseAndTryCast(request, BoxResourceType.COMMENT, getObjectMapper());
}
 
開發者ID:mobilesystems,項目名稱:box-java-sdk-v2,代碼行數:21,代碼來源:BoxCommentsManager.java

示例9: updateComment

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
/**
 * Update a comment.
 * 
 * @param commentId
 *            id of the comment
 * @param requestObject
 *            comment request object.s
 * @return comment
 * @throws BoxRestException
 *             exception
 * @throws BoxServerException
 *             exception
 * @throws AuthFatalFailureException
 *             exception indicating authentication totally failed
 */
public BoxComment updateComment(final String commentId, final BoxCommentRequestObject requestObject) throws BoxRestException, BoxServerException,
    AuthFatalFailureException {
    UpdateCommentRequest request = new UpdateCommentRequest(getConfig(), getObjectMapper(), commentId, requestObject);
    return (BoxComment) getResponseAndParseAndTryCast(request, BoxResourceType.COMMENT, getObjectMapper());
}
 
開發者ID:mobilesystems,項目名稱:box-java-sdk-v2,代碼行數:21,代碼來源:BoxCommentsManager.java

示例10: setItem

import com.box.boxjavalibv2.dao.BoxComment; //導入依賴的package包/類
/**
 * Set the item to be commented.
 * 
 * @param type
 *            type of the item
 * @param itemId
 *            id of the item
 * @return BoxCommentRequestObject
 */
public BoxCommentRequestObject setItem(final BoxResourceType type, final String itemId) {
    put(BoxComment.FIELD_ITEM, getItemEntity(type, itemId));
    return this;
}
 
開發者ID:mobilesystems,項目名稱:box-java-sdk-v2,代碼行數:14,代碼來源:BoxCommentRequestObject.java


注:本文中的com.box.boxjavalibv2.dao.BoxComment類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。