Package com.box.boxjavalibv2.dao

Examples of com.box.boxjavalibv2.dao.BoxCollection


     *             exception
     */
    public List<BoxEmailAlias> getEmailAliases(final String userId, final BoxDefaultRequestObject requestObject) throws BoxServerException, BoxRestException,
        AuthFatalFailureException {
        GetEmailAliasesRequest request = new GetEmailAliasesRequest(getConfig(), getObjectMapper(), userId, requestObject);
        BoxCollection collection = (BoxCollection) getResponseAndParseAndTryCast(request, BoxResourceType.EMAIL_ALIASES, getObjectMapper());
        return getEmailAliases(collection);
    }
View Full Code Here


    @Override
    public List<BoxUser> getAllEnterpriseUser(final BoxDefaultRequestObject requestObject, final String filterTerm) throws BoxRestException,
        BoxServerException, AuthFatalFailureException {
        GetAllUsersInEnterpriseRequest request = new GetAllUsersInEnterpriseRequest(getConfig(), getJSONParser(), requestObject, filterTerm);
        BoxCollection collection = (BoxCollection) getResponseAndParseAndTryCast(request, BoxResourceType.USERS, getJSONParser());
        return getUsers(collection);
    }
View Full Code Here

    @Override
    public List<BoxEmailAlias> getEmailAliases(final String userId, final BoxDefaultRequestObject requestObject) throws BoxServerException, BoxRestException,
        AuthFatalFailureException {
        GetEmailAliasesRequest request = new GetEmailAliasesRequest(getConfig(), getJSONParser(), userId, requestObject);
        BoxCollection collection = (BoxCollection) getResponseAndParseAndTryCast(request, BoxResourceType.EMAIL_ALIASES, getJSONParser());
        return getEmailAliases(collection);
    }
View Full Code Here

    @Override
    public List<BoxFileVersion> getFileVersions(final String fileId, final BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException,
        AuthFatalFailureException {
        GetFileVersionsRequest request = new GetFileVersionsRequest(getConfig(), getJSONParser(), fileId, requestObject);
        BoxCollection collection = (BoxCollection) getResponseAndParseAndTryCast(request, BoxResourceType.FILE_VERSIONS, getJSONParser());
        return getFileVersions(collection);
    }
View Full Code Here

    public BoxFile execute(BoxFilesManagerImpl manager, BoxFileUploadRequestObject requestObject) throws BoxServerException, BoxRestException,
        AuthFatalFailureException, InterruptedException {
        UploadFileRequest request = new UploadFileRequest(mConfig, manager.getJSONParser(), requestObject);
        try {
            Object result = manager.getResponseAndParse(request, BoxResourceType.FILES, manager.getJSONParser());
            BoxCollection collection = (BoxCollection) manager.tryCastObject(BoxResourceType.FILES, result);
            Class cls = manager.getResourceHub().getClass(BoxResourceType.FILE);
            return (BoxFile) Utils.getTypedObjects(collection, cls).get(0);
        }
        catch (BoxRestException e) {
            if (isInterruptedMultipartException(e)) {
View Full Code Here

    public BoxFile execute(final String fileId, BoxFilesManagerImpl manager, BoxFileUploadRequestObject requestObject) throws BoxServerException,
        BoxRestException, AuthFatalFailureException, InterruptedException {
        UploadNewVersionFileRequest request = new UploadNewVersionFileRequest(mConfig, manager.getJSONParser(), fileId, requestObject);
        try {
            Object result = manager.getResponseAndParse(request, BoxResourceType.FILE_VERSIONS, manager.getJSONParser());
            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

    @Override
    public List<BoxCollaboration> getAllCollaborations(final BoxGetAllCollabsRequestObject collabObject) throws BoxRestException, BoxServerException,
        AuthFatalFailureException {
        GetAllCollaborationsRequest request = new GetAllCollaborationsRequest(getConfig(), getJSONParser(), collabObject);

        BoxCollection collection = (BoxCollection) getResponseAndParseAndTryCast(request, BoxResourceType.COLLABORATIONS, getJSONParser());
        return getCollaborations(collection);
    }
View Full Code Here

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

        BoxCollection collection = (BoxCollection) getResponseAndParseAndTryCast(request, BoxResourceType.COLLABORATIONS, getJSONParser());
        return Utils.getTypedObjects(collection, BoxCollaboration.class);
    }
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.dao.BoxCollection

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.