1414 */
1515public class BintrayClient {
1616
17- public static final int DEFAULT_TIMEOUT = 15000 ;
17+ public static final int DEFAULT_TIMEOUT = 150000 ;
1818 public static final String BINTRAY_API_URL = "https://api.bintray.com" ;
1919 public static final String USER_AGENT = "BintrayJavaClient/0.5" ; // TODO: make dynamic
20+ private static final int DEFAULT_THREAD_POOL_SIZE = 5 ; //Don't mess with this - its here for a reason
2021
2122 //Mainly used by Artifactory to avoid all of the configuration, but you can specify your own too
22- static public Bintray create (CloseableHttpClient preConfiguredClient , String url ) {
23- return new BintrayImpl (preConfiguredClient , url );
23+ static public Bintray create (CloseableHttpClient preConfiguredClient , String url , int threadPoolSize ) {
24+ return new BintrayImpl (preConfiguredClient , url , threadPoolSize );
2425 }
2526
2627 /**
2728 * Username and API key, no proxy
2829 */
2930 static public Bintray create (String userName , String apiKey ) {
3031 UsernamePasswordCredentials creds = new UsernamePasswordCredentials (userName , apiKey );
31- return new BintrayImpl (createClient (creds , null , BINTRAY_API_URL ), BINTRAY_API_URL );
32+ return new BintrayImpl (createClient (creds , null , BINTRAY_API_URL ), BINTRAY_API_URL , DEFAULT_THREAD_POOL_SIZE );
3233 }
3334
3435 /**
3536 * Username, API key, and custom url
3637 */
3738 static public Bintray create (String url , String userName , String apiKey ) {
3839 UsernamePasswordCredentials creds = new UsernamePasswordCredentials (userName , apiKey );
39- return new BintrayImpl (createClient (creds , null , BINTRAY_API_URL ), BINTRAY_API_URL );
40+ return new BintrayImpl (createClient (creds , null , BINTRAY_API_URL ), BINTRAY_API_URL , DEFAULT_THREAD_POOL_SIZE );
4041 }
4142
4243 /**
4344 * Credentials with proxy
4445 */
4546 static public Bintray create (UsernamePasswordCredentials creds , HttpClientConfigurator .ProxyConfig proxyConfig ) {
46- return new BintrayImpl (createClient (creds , proxyConfig , BINTRAY_API_URL ), BINTRAY_API_URL );
47+ return new BintrayImpl (createClient (creds , proxyConfig , BINTRAY_API_URL ), BINTRAY_API_URL , DEFAULT_THREAD_POOL_SIZE );
4748 }
4849
4950 /**
@@ -52,7 +53,7 @@ static public Bintray create(UsernamePasswordCredentials creds, HttpClientConfig
5253 static public Bintray create (String bintrayUserName , String bintrayApiKey ,
5354 HttpClientConfigurator .ProxyConfig proxyConfig , String url ) {
5455 UsernamePasswordCredentials creds = new UsernamePasswordCredentials (bintrayUserName , bintrayApiKey );
55- return new BintrayImpl (createClient (creds , proxyConfig , url ), url );
56+ return new BintrayImpl (createClient (creds , proxyConfig , url ), url , DEFAULT_THREAD_POOL_SIZE );
5657 }
5758
5859
0 commit comments