Package com.box.boxjavalibv2.jsonentities

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity


                    values.put(BoxOAuthToken.FIELD_REFRESH_TOKEN, refreshToken);
                    return new BoxOAuthToken(values);
                }
            }
        });
        configuration.setRefreshListener(new OAuthRefreshListener() {
            @Override
            public void onRefresh(IAuthData newAuthData) {
                log.debug("Refreshed OAuth data: " + ((newAuthData != null) ? newAuthData.getAccessToken() : null));
            }
        });
View Full Code Here


        // authorize application on user's behalf
        try {
            final String csrfId = String.valueOf(new SecureRandom().nextLong());

            OAuthWebViewData viewData = new OAuthWebViewData(boxClient.getOAuthDataController());
            viewData.setOptionalState(String.valueOf(csrfId));
            final HtmlPage authPage = webClient.getPage(viewData.buildUrl().toString());

            // submit login credentials
            final HtmlForm loginForm = authPage.getFormByName("login_form");
            final HtmlTextInput login = loginForm.getInputByName("login");
            login.setText(configuration.getUserName());
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

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

TOP

Related Classes of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

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.