@Test public void testConnect() throws Exception { assertTrue(session.isConnected()); session.close(); assertFalse(session.isConnected()); }
@Override protected Drive connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt) { final HttpClientBuilder configuration = builder.build(proxy, this, prompt); authorizationService = new OAuth2RequestInterceptor(configuration.build(), host.getProtocol()) .withRedirectUri(host.getProtocol().getOAuthRedirectUrl()); configuration.addInterceptorLast(authorizationService); configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService, prompt)); configuration.addInterceptorLast(new RateLimitingHttpRequestInterceptor(new DefaultHttpRateLimiter( PreferencesFactory.get().getInteger("googledrive.limit.requests.second") ))); this.transport = new ApacheHttpTransport(configuration.build()); final UseragentProvider ua = new PreferencesUseragentProvider(); return new Drive.Builder(transport, new JacksonFactory(), new UserAgentHttpRequestInitializer(ua)) .setApplicationName(ua.get()) .build(); }
DriveSession extends HttpSession<Drive> { @Override protected Drive connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt) { final HttpClientBuilder configuration = builder.build(proxy, this, prompt); authorizationService = new OAuth2RequestInterceptor(configuration.build(), host.getProtocol()) .withRedirectUri(host.getProtocol().getOAuthRedirectUrl()); configuration.addInterceptorLast(authorizationService); configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService, prompt)); configuration.addInterceptorLast(new RateLimitingHttpRequestInterceptor(new DefaultHttpRateLimiter( PreferencesFactory.get().getInteger("googledrive.limit.requests.second") ))); this.transport = new ApacheHttpTransport(configuration.build()); final UseragentProvider ua = new PreferencesUseragentProvider(); return new Drive.Builder(transport, new JacksonFactory(), new UserAgentHttpRequestInitializer(ua)) .setApplicationName(ua.get()) .build(); } }
DriveSession extends HttpSession<Drive> { @Override protected Drive connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt) { final HttpClientBuilder configuration = builder.build(proxy, this, prompt); authorizationService = new OAuth2RequestInterceptor(configuration.build(), host.getProtocol()) .withRedirectUri(host.getProtocol().getOAuthRedirectUrl()); configuration.addInterceptorLast(authorizationService); configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService, prompt)); configuration.addInterceptorLast(new RateLimitingHttpRequestInterceptor(new DefaultHttpRateLimiter( PreferencesFactory.get().getInteger("googledrive.limit.requests.second") ))); this.transport = new ApacheHttpTransport(configuration.build()); final UseragentProvider ua = new PreferencesUseragentProvider(); return new Drive.Builder(transport, new JacksonFactory(), new UserAgentHttpRequestInitializer(ua)) .setApplicationName(ua.get()) .build(); } DriveSession(final Host host, final X509TrustManager trust, final X509KeyManager key); }
DriveSession extends HttpSession<Drive> { @Override protected Drive connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt) { final HttpClientBuilder configuration = builder.build(proxy, this, prompt); authorizationService = new OAuth2RequestInterceptor(configuration.build(), host.getProtocol()) .withRedirectUri(host.getProtocol().getOAuthRedirectUrl()); configuration.addInterceptorLast(authorizationService); configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService, prompt)); configuration.addInterceptorLast(new RateLimitingHttpRequestInterceptor(new DefaultHttpRateLimiter( PreferencesFactory.get().getInteger("googledrive.limit.requests.second") ))); this.transport = new ApacheHttpTransport(configuration.build()); final UseragentProvider ua = new PreferencesUseragentProvider(); return new Drive.Builder(transport, new JacksonFactory(), new UserAgentHttpRequestInitializer(ua)) .setApplicationName(ua.get()) .build(); } DriveSession(final Host host, final X509TrustManager trust, final X509KeyManager key); @Override void login(final Proxy proxy, final LoginCallback prompt, final CancelCallback cancel); HttpClient getHttpClient(); @Override @SuppressWarnings("unchecked") T _getFeature(Class<T> type); }
DriveSession extends HttpSession<Drive> { @Override protected Drive connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt) { final HttpClientBuilder configuration = builder.build(proxy, this, prompt); authorizationService = new OAuth2RequestInterceptor(configuration.build(), host.getProtocol()) .withRedirectUri(host.getProtocol().getOAuthRedirectUrl()); configuration.addInterceptorLast(authorizationService); configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService, prompt)); configuration.addInterceptorLast(new RateLimitingHttpRequestInterceptor(new DefaultHttpRateLimiter( PreferencesFactory.get().getInteger("googledrive.limit.requests.second") ))); this.transport = new ApacheHttpTransport(configuration.build()); final UseragentProvider ua = new PreferencesUseragentProvider(); return new Drive.Builder(transport, new JacksonFactory(), new UserAgentHttpRequestInitializer(ua)) .setApplicationName(ua.get()) .build(); } DriveSession(final Host host, final X509TrustManager trust, final X509KeyManager key); @Override void login(final Proxy proxy, final LoginCallback prompt, final CancelCallback cancel); HttpClient getHttpClient(); @Override @SuppressWarnings("unchecked") T _getFeature(Class<T> type);  }