Package com.box.boxjavalibv2

Examples of com.box.boxjavalibv2.BoxConfigBuilder


     * @param clientSecret       client secret to use when authenticating with the API
     * @param redirectUrl        redirect URL to use with OAuth
     */
    @Override
    public void initializeAuthFlow(Object activity, String clientId, String clientSecret, String redirectUrl) {
        client = new BoxClient(clientId, clientSecret, null, null, (new BoxConfigBuilder()).build());
        initializeAuthFlow(activity, clientId, clientSecret, redirectUrl, client);
    }
View Full Code Here


    @Test
    public void testListenerCompleteDownload() throws IOException, BoxRestException {
        final TestInputStream stream = new TestInputStream();
        final StateKeepingFileTransferListener listener = new StateKeepingFileTransferListener();
        final BoxFileDownload testDownload = new BoxFileDownload(new BoxConfigBuilder().build(), new TestingDownloadRESTClient(stream), null);
        testDownload.setProgressListener(listener);
        new Thread() {

            public void run() {
                try {
View Full Code Here

    @Test
    public void testListenerCancelDownload() throws IOException, BoxRestException {
        final TestInputStream stream = new TestInputStream();
        final StateKeepingFileTransferListener listener = new StateKeepingFileTransferListener();
        final BoxFileDownload testDownload = new BoxFileDownload(new BoxConfigBuilder().build(), new TestingDownloadRESTClient(stream), null);
        testDownload.setProgressListener(listener);
        final FutureTask<Void> task = new FutureTask<Void>(new Callable<Void>() {

            @Override
            public Void call() throws Exception {
View Full Code Here

    @Test
    public void testListenerErrorDownload() throws IOException, BoxRestException {
        final TestInputStream stream = new TestInputStream();
        final StateKeepingFileTransferListener listener = new StateKeepingFileTransferListener();
        final BoxFileDownload testDownload = new BoxFileDownload(new BoxConfigBuilder().build(), new TestingDownloadRESTClient(stream), null);
        testDownload.setProgressListener(listener);
        new Thread() {

            public void run() {
                try {
View Full Code Here

                + "clientId, clientSecret, userName and either authSecureStorage or userPassword");
        }
        LOG.debug("Creating BoxClient for login:{}, client_id:{} ...", userName, clientId);

        // if set, use configured connection manager builder
        final BoxConnectionManagerBuilder connectionManagerBuilder = configuration.getConnectionManagerBuilder();
        final BoxConnectionManagerBuilder connectionManager = connectionManagerBuilder != null
            ? connectionManagerBuilder : new BoxConnectionManagerBuilder();

        // create REST client for BoxClient
        final ClientConnectionManager[] clientConnectionManager = new ClientConnectionManager[1];
        final IBoxRESTClient restClient = new BoxRESTClient(connectionManager.build()) {
            @Override
            public HttpClient getRawHttpClient() {
                final HttpClient httpClient = super.getRawHttpClient();
                clientConnectionManager[0] = httpClient.getConnectionManager();
                final SchemeRegistry schemeRegistry = clientConnectionManager[0].getSchemeRegistry();
View Full Code Here

                + "clientId, clientSecret, userName and either authSecureStorage or userPassword");
        }
        LOG.debug("Creating BoxClient for login:{}, client_id:{} ...", userName, clientId);

        // if set, use configured connection manager builder
        final BoxConnectionManagerBuilder connectionManagerBuilder = configuration.getConnectionManagerBuilder();
        final BoxConnectionManagerBuilder connectionManager = connectionManagerBuilder != null
            ? connectionManagerBuilder : new BoxConnectionManagerBuilder();

        // create REST client for BoxClient
        final ClientConnectionManager[] clientConnectionManager = new ClientConnectionManager[1];
        final IBoxRESTClient restClient = new BoxRESTClient(connectionManager.build()) {
            @Override
            public HttpClient getRawHttpClient() {
                final HttpClient httpClient = super.getRawHttpClient();
                clientConnectionManager[0] = httpClient.getConnectionManager();
View Full Code Here

        final BoxConnectionManagerBuilder connectionManager = connectionManagerBuilder != null
            ? connectionManagerBuilder : new BoxConnectionManagerBuilder();

        // create REST client for BoxClient
        final ClientConnectionManager[] clientConnectionManager = new ClientConnectionManager[1];
        final IBoxRESTClient restClient = new BoxRESTClient(connectionManager.build()) {
            @Override
            public HttpClient getRawHttpClient() {
                final HttpClient httpClient = super.getRawHttpClient();
                clientConnectionManager[0] = httpClient.getConnectionManager();
                final SchemeRegistry schemeRegistry = clientConnectionManager[0].getSchemeRegistry();
View Full Code Here

        final BoxConnectionManagerBuilder connectionManager = connectionManagerBuilder != null
            ? connectionManagerBuilder : new BoxConnectionManagerBuilder();

        // create REST client for BoxClient
        final ClientConnectionManager[] clientConnectionManager = new ClientConnectionManager[1];
        final IBoxRESTClient restClient = new BoxRESTClient(connectionManager.build()) {
            @Override
            public HttpClient getRawHttpClient() {
                final HttpClient httpClient = super.getRawHttpClient();
                clientConnectionManager[0] = httpClient.getConnectionManager();
View Full Code Here

                boxClient.authenticateFromSecureStorage(authSecureStorage);
            } else {

                LOG.debug("Using OAuth {}", cachedBoxClient);
                // authorize App for user, and create OAuth token with refresh token
                final IAuthFlowUI authFlowUI = new LoginAuthFlowUI(configuration, boxClient);
                final CountDownLatch latch = new CountDownLatch(1);
                final LoginAuthFlowListener listener = new LoginAuthFlowListener(latch);
                boxClient.authenticate(authFlowUI, true, listener);

                // wait for login to finish or timeout
View Full Code Here

                boxClient.authenticateFromSecureStorage(authSecureStorage);
            } else {

                LOG.debug("Using OAuth {}", cachedBoxClient);
                // authorize App for user, and create OAuth token with refresh token
                final IAuthFlowUI authFlowUI = new LoginAuthFlowUI(configuration, boxClient);
                final CountDownLatch latch = new CountDownLatch(1);
                final LoginAuthFlowListener listener = new LoginAuthFlowListener(latch);
                boxClient.authenticate(authFlowUI, true, listener);

                // wait for login to finish or timeout
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.