Examples of BoxCollection


Examples of com.box.boxjavalibv2.dao.BoxCollection

    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

Examples of com.box.boxjavalibv2.dao.BoxCollection

        // 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

Examples of com.box.boxjavalibv2.dao.BoxCollection

            // 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

Examples of com.box.boxjavalibv2.dao.BoxCollection

    }

    @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

Examples of com.box.boxjavalibv2.dao.BoxCollection

            // 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

Examples of com.box.boxjavalibv2.dao.BoxCollection

        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

Examples of com.box.boxjavalibv2.dao.BoxCollection

    public BoxFile execute(BoxFilesManager manager, BoxFileUploadRequestObject requestObject) throws BoxServerException, BoxRestException,
        AuthFatalFailureException, InterruptedException {
        UploadFileRequest request = new UploadFileRequest(mConfig, manager.getObjectMapper(), requestObject);
        try {
            Object result = manager.getResponseAndParse(request, BoxResourceType.FILES, manager.getObjectMapper());
            BoxCollection collection = (BoxCollection) manager.tryCastObject(BoxResourceType.FILES, result);
            return BoxFilesManager.getFiles(collection).get(0);
        }
        catch (BoxRestException e) {
            if (isInterruptedMultipartException(e)) {
                throw new InterruptedException();
View Full Code Here

Examples of com.box.boxjavalibv2.dao.BoxCollection

    public BoxFile execute(final String fileId, BoxFilesManager manager, BoxFileUploadRequestObject requestObject) throws BoxServerException, BoxRestException,
        AuthFatalFailureException, InterruptedException {
        UploadNewVersionFileRequest request = new UploadNewVersionFileRequest(mConfig, manager.getObjectMapper(), fileId, requestObject);
        try {
            Object result = manager.getResponseAndParse(request, BoxResourceType.FILE_VERSIONS, manager.getObjectMapper());
            BoxCollection versions = (BoxCollection) manager.tryCastObject(BoxResourceType.FILE_VERSIONS, result);
            if (versions.getTotalCount() != 1) {
                throw new BoxMalformedResponseException(request.getExpectedResponseCode());
            }
            return (BoxFile) versions.getEntries().get(0);
        }
        catch (BoxRestException e) {
            if (isInterruptedMultipartException(e)) {
                throw new InterruptedException();
            }
View Full Code Here

Examples of com.box.boxjavalibv2.dao.BoxCollection

     *             exception indicating authentication totally failed
     */
    public List<BoxFileVersion> getFileVersions(final String fileId, final BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException,
        AuthFatalFailureException {
        GetFileVersionsRequest request = new GetFileVersionsRequest(getConfig(), getObjectMapper(), fileId, requestObject);
        BoxCollection collection = (BoxCollection) getResponseAndParseAndTryCast(request, BoxResourceType.FILE_VERSIONS, getObjectMapper());
        return getFileVersions(collection);
    }
View Full Code Here

Examples of com.box.boxjavalibv2.dao.BoxCollection

     */
    public List<BoxCollaboration> getFolderCollaborations(final String folderId, BoxDefaultRequestObject requestObject) throws BoxRestException,
        BoxServerException, AuthFatalFailureException {
        GetFolderCollaborationsRequest request = new GetFolderCollaborationsRequest(getConfig(), getObjectMapper(), folderId, requestObject);

        BoxCollection collection = (BoxCollection) getResponseAndParseAndTryCast(request, BoxResourceType.COLLABORATIONS, getObjectMapper());
        return BoxCollaborationsManager.getCollaborations(collection);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.