Package com.box.boxjavalibv2.filetransfer

Examples of com.box.boxjavalibv2.filetransfer.BoxFileDownload


    }

    @Ignore("Requires multiple confirmed email aliases, do disabled by default")
    @Test
    public void testUpdateUserPrimaryLogin() throws Exception {
        final BoxUser enterpriseUser = createEnterpriseUser();

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.userId", enterpriseUser.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxUserUpdateLoginRequestObject
            final BoxUserUpdateLoginRequestObject requestObject =
                    BoxUserUpdateLoginRequestObject.updateUserPrimaryLoginRequestObject(UPDATED_EMAIL_ALIAS);
            headers.put("CamelBox.userUpdateLoginRequest", requestObject);

            BoxUser result = requestBodyAndHeaders("direct://UPDATEUSERPRIMARYLOGIN", null, headers);

            assertNotNull("updateUserPrimaryLogin result", result);
            assertEquals("updateUserPrimaryLogin primary login", UPDATED_EMAIL_ALIAS, result.getLogin());
            LOG.debug("updateUserPrimaryLogin: " + result);
        } finally {
            deleteEnterpriseUser(enterpriseUser.getId());
        }
    }
View Full Code Here


     * @throws AuthFatalFailureException
     *             exception indicating authenticating totally failed
     */
    public void downloadFile(final String fileId, final File destination, final IFileTransferListener listener, BoxDefaultRequestObject requestObject)
        throws BoxRestException, BoxServerException, IllegalStateException, IOException, InterruptedException, AuthFatalFailureException {
        BoxFileDownload download = new BoxFileDownload(getConfig(), getRestClient(), fileId);
        download.setProgressListener(listener);
        download.execute(getAuth(), destination, getObjectMapper(), requestObject);
    }
View Full Code Here

     * @throws AuthFatalFailureException
     *             exception indicating authenticating totally failed
     */
    public InputStream downloadFile(final String fileId, final BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException,
        AuthFatalFailureException {
        BoxFileDownload download = new BoxFileDownload(getConfig(), getRestClient(), fileId);
        return download.execute(getAuth(), getObjectMapper(), requestObject);
    }
View Full Code Here

     * @throws AuthFatalFailureException
     *             exception indicating authenticating totally failed
     */
    public void downloadFile(final String fileId, final OutputStream[] outputStreams, final IFileTransferListener listener,
        final BoxDefaultRequestObject requestObject) throws BoxRestException, IOException, BoxServerException, InterruptedException, AuthFatalFailureException {
        BoxFileDownload download = new BoxFileDownload(getConfig(), getRestClient(), fileId);
        download.setProgressListener(listener);
        download.execute(getAuth(), outputStreams, getObjectMapper(), requestObject);
    }
View Full Code Here

    }

    @Override
    public void downloadFile(final String fileId, final File destination, final IFileTransferListener listener, BoxDefaultRequestObject requestObject)
        throws BoxRestException, BoxServerException, IllegalStateException, IOException, InterruptedException, AuthFatalFailureException {
        BoxFileDownload download = new BoxFileDownload(getConfig(), getRestClient(), fileId);
        download.setProgressListener(listener);
        download.execute(getAuth(), destination, getJSONParser(), requestObject);
    }
View Full Code Here

    }

    @Override
    public InputStream downloadFile(final String fileId, final BoxDefaultRequestObject requestObject) throws BoxRestException, BoxServerException,
        AuthFatalFailureException {
        BoxFileDownload download = new BoxFileDownload(getConfig(), getRestClient(), fileId);
        return download.execute(getAuth(), getJSONParser(), requestObject);
    }
View Full Code Here

    }

    @Override
    public void downloadFile(final String fileId, final OutputStream[] outputStreams, final IFileTransferListener listener,
        final BoxDefaultRequestObject requestObject) throws BoxRestException, IOException, BoxServerException, InterruptedException, AuthFatalFailureException {
        BoxFileDownload download = new BoxFileDownload(getConfig(), getRestClient(), fileId);
        download.setProgressListener(listener);
        download.execute(getAuth(), outputStreams, getJSONParser(), requestObject);
    }
View Full Code Here

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.folderId", testFolder.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxSharedLinkRequestObject
            final BoxSharedLinkRequestEntity sharedLink = new BoxSharedLinkRequestEntity(
                    BoxSharedLinkAccess.COLLABORATORS);
            headers.put("CamelBox.sharedLinkRequest",
                    BoxSharedLinkRequestObject.createSharedLinkRequestObject(sharedLink));

            BoxFolder result = requestBodyAndHeaders("direct://CREATESHAREDLINK", null, headers);
View Full Code Here

    private BoxCollaboration createCollaboration() throws InterruptedException {
        final Map<String, Object> headers = new HashMap<String, Object>();
        // parameter type is String
        headers.put("CamelBox.folderId", testFolderId);
        // 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);
View Full Code Here

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

TOP

Related Classes of com.box.boxjavalibv2.filetransfer.BoxFileDownload

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.