当前位置: 首页>>代码示例>>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;未经允许,请勿转载。