|
1 | 1 | package com.box.sdk; |
2 | 2 |
|
3 | 3 | import java.net.MalformedURLException; |
| 4 | +import java.net.Proxy; |
4 | 5 | import java.net.URL; |
5 | 6 | import java.util.ArrayList; |
6 | 7 | import java.util.List; |
@@ -41,6 +42,10 @@ public class BoxAPIConnection { |
41 | 42 | private volatile long lastRefresh; |
42 | 43 | private volatile long expires; |
43 | 44 |
|
| 45 | + private Proxy proxy; |
| 46 | + private String proxyUsername; |
| 47 | + private String proxyPassword; |
| 48 | + |
44 | 49 | private String userAgent; |
45 | 50 | private String accessToken; |
46 | 51 | private String refreshToken; |
@@ -330,6 +335,54 @@ public void setMaxRequestAttempts(int attempts) { |
330 | 335 | this.maxRequestAttempts = attempts; |
331 | 336 | } |
332 | 337 |
|
| 338 | + /** |
| 339 | + * Gets the proxy value to use for API calls to Box. |
| 340 | + * @return current proxy value |
| 341 | + */ |
| 342 | + public Proxy getProxy() { |
| 343 | + return this.proxy; |
| 344 | + } |
| 345 | + |
| 346 | + /** |
| 347 | + * Sets the Proxy to use for API calls to Box. |
| 348 | + * @param proxy the current Proxy |
| 349 | + */ |
| 350 | + public void setProxy(Proxy proxy) { |
| 351 | + this.proxy = proxy; |
| 352 | + } |
| 353 | + |
| 354 | + /** |
| 355 | + * Gets the username to use for a Proxy that requires basic auth. |
| 356 | + * @return username to use for a Proxy that requires basic auth |
| 357 | + */ |
| 358 | + public String getProxyUsername() { |
| 359 | + return this.proxyUsername; |
| 360 | + } |
| 361 | + |
| 362 | + /** |
| 363 | + * Sets the username to use for a Proxy that requires basic auth. |
| 364 | + * @param proxyUsername username to use for a Proxy that requires basic auth |
| 365 | + */ |
| 366 | + public void setProxyUsername(String proxyUsername) { |
| 367 | + this.proxyUsername = proxyUsername; |
| 368 | + } |
| 369 | + |
| 370 | + /** |
| 371 | + * Gets the password to use for a Proxy that requires basic auth. |
| 372 | + * @return password to use for a Proxy that requires basic auth |
| 373 | + */ |
| 374 | + public String getProxyPassword() { |
| 375 | + return this.proxyPassword; |
| 376 | + } |
| 377 | + |
| 378 | + /** |
| 379 | + * Sets the password to use for a Proxy that requires basic auth. |
| 380 | + * @param proxyPassword password to use for a Proxy that requires basic auth |
| 381 | + */ |
| 382 | + public void setProxyPassword(String proxyPassword) { |
| 383 | + this.proxyPassword = proxyPassword; |
| 384 | + } |
| 385 | + |
333 | 386 | /** |
334 | 387 | * Determines if this connection's access token can be refreshed. An access token cannot be refreshed if a refresh |
335 | 388 | * token was never set. |
|
0 commit comments