Package com.box.boxjavalibv2

Examples of com.box.boxjavalibv2.BoxConfigBuilder


        // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxCollabRequestObject
        final BoxCollabRequestObject collabObject = BoxCollabRequestObject.createCollabObject(testFolderId, null,
                "camel.test@localhost.com", BoxCollaborationRole.VIEWER);
        headers.put("CamelBox.collabRequest", collabObject);

        BoxCollaboration result = requestBodyAndHeaders("direct://CREATECOLLABORATION",
                null, headers);
        assertNotNull("createCollaboration result", result);
        // wait a moment for collaboration to register
        Thread.sleep(2000);
        return result;
View Full Code Here


        LOG.debug("getAllCollaborations: " + result);
    }

    @Test
    public void testGetCollaboration() throws Exception {
        final BoxCollaboration collaboration = createCollaboration();

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.collabId", collaboration.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
            headers.put("CamelBox.defaultRequest", null);

            BoxCollaboration result = requestBodyAndHeaders("direct://GETCOLLABORATION", null, headers);
            assertNotNull("getCollaboration result", result);
            LOG.debug("getCollaboration: " + result);
        } finally {
            deleteCollaboration(collaboration.getId());
        }
View Full Code Here

    }

    @Ignore("BoxClient SDK has a bug in UpdateCollaborationRequest.java, the URI constant should be collaborations")
    @Test
    public void testUpdateCollaboration() throws Exception {
        final BoxCollaboration collaboration = createCollaboration();

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.collabId", collaboration.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxCollabRequestObject
            final BoxCollabRequestObject requestObject = BoxCollabRequestObject.updateCollabObjects(
                    BoxCollaborationRole.EDITOR);
            headers.put("CamelBox.collabRequest", requestObject);

            BoxCollaboration result = requestBodyAndHeaders("direct://UPDATECOLLABORATION", null, headers);
            assertNotNull("updateCollaboration result", result);
            LOG.debug("updateCollaboration: " + result);
        } finally {
            deleteCollaboration(collaboration.getId());
        }
View Full Code Here

    private static final String PATH_PREFIX = BoxApiCollection.getCollection().getApiName(IBoxEventsManagerApiMethod.class).getName();

    @Test
    public void testGetEventOptions() throws Exception {
        // using com.box.restclientv2.requestsbase.BoxDefaultRequestObject message body for single parameter "defaultRequest"
        BoxCollection result = requestBody("direct://GETEVENTOPTIONS", null);

        assertNotNull("getEventOptions result", result);
        LOG.debug("getEventOptions: " + result);
    }
View Full Code Here

        // parameter type is String
        headers.put("CamelBox.folderId", "0");
        // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxPagingRequestObject
        headers.put("CamelBox.pagingRequest", BOX_PAGING_REQUEST_OBJECT);

        BoxCollection result = requestBodyAndHeaders("direct://GETFOLDERITEMS", null, headers);
        assertNotNull(result);
        LOG.debug("getFolderItems: " + result);
    }
View Full Code Here

            // parameter type is String
            headers.put("CamelBox.groupId", group.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
//            headers.put("CamelBox.defaultRequest", null);

            BoxCollection result = requestBodyAndHeaders("direct://GETALLCOLLABORATIONS", null, headers);

            assertNotNull("getAllCollaborations result", result);
            LOG.debug("getAllCollaborations: " + result);
        } finally {
            deleteGroup(group.getId());
View Full Code Here

    }

    @Test
    public void testGetAllGroups() throws Exception {
        // using com.box.restclientv2.requestsbase.BoxDefaultRequestObject message body for single parameter "defaultRequest"
        BoxCollection result = requestBody("direct://GETALLGROUPS", null);

        assertNotNull("getAllGroups result", result);
        LOG.debug("getAllGroups: " + result);
    }
View Full Code Here

            // parameter type is String
            headers.put("CamelBox.groupId", group.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
            headers.put("CamelBox.defaultRequest", null);

            BoxCollection result = requestBodyAndHeaders("direct://GETMEMBERSHIPS", null, headers);

            assertNotNull("getMemberships result", result);
            LOG.debug("getMemberships: " + result);
        } finally {
            deleteGroup(group.getId());
View Full Code Here

        throws BoxRestException, BoxServerException, AuthFatalFailureException {

        final BoxEventRequestObject optionsRequest =
            BoxEventRequestObject.getEventsRequestObject(currentStreamPosition);

        final BoxCollection eventOptions = eventsManager.getEventOptions(optionsRequest);
        final ArrayList<BoxTypedObject> entries = eventOptions.getEntries();

        // validate options
        if (entries == null || entries.size() < 1
            || !(entries.get(0) instanceof BoxRealTimeServer)) {
View Full Code Here

    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;
    }
View Full Code Here

TOP

Related Classes of com.box.boxjavalibv2.BoxConfigBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.