public BeamHttpClient(BeamAPI beam, String httpUsername, String httpPassword, String oauthToken) { this.beam = beam; this.cookieStore = new BasicCookieStore(); if (httpUsername != null && httpPassword != null) { this.context = HttpClientContext.create(); AuthCache ac = new BasicAuthCache(); ac.put(new HttpHost(this.beam.basePath.getHost()), new BasicScheme()); this.context.setAuthCache(ac); CredentialsProvider cp = new BasicCredentialsProvider(); cp.setCredentials( AuthScope.ANY, new UsernamePasswordCredentials(httpUsername, httpPassword) ); this.context.setCredentialsProvider(cp); } else { this.context = null; } this.http = this.buildHttpClient(); if (oauthToken != null) { this.oauthToken = oauthToken; } }
public AbstractBeamService(BeamAPI beam) { this.beam = beam; }
public BeamHttpClient(BeamAPI beam, String oauthToken) : this(beam, null, null, oauthToken) { }
public BeamHttpClient(BeamAPI beam, String httpUsername, String httpPassword) : this(beam, httpUsername, httpPassword, null) { }
public BeamHttpClient(BeamAPI beam) : this(beam, null, null) { }