Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,21 @@ public T maxTotalConnections(int maxTotalConnections) {
return self();
}

/**
* Sets the connection timeout in milliseconds (Apache HttpClient 4.x {@link RequestConfig.Builder#setConnectTimeout(int)}).
*
* @param connectionTimeout timeout in milliseconds
*/
public T connectionTimeout(int connectionTimeout) {
config.setConnectTimeout(connectionTimeout);
return self();
}

/**
* Sets the socket (read) timeout in milliseconds (Apache HttpClient 4.x {@link RequestConfig.Builder#setSocketTimeout(int)}).
*
* @param soTimeout timeout in milliseconds
*/
public T socketTimeout(int soTimeout) {
config.setSocketTimeout(soTimeout);
return self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ public class ArtifactoryClientBuilder {
private String url;
private String username;
private String password;
/**
* Connection timeout in milliseconds (Apache HttpClient 4.x {@code RequestConfig#setConnectTimeout}).
*/
private Integer connectionTimeout;
/**
* Socket timeout in milliseconds (Apache HttpClient 4.x {@code RequestConfig#setSocketTimeout}).
*/
private Integer socketTimeout;
private ProxyConfig proxy;
private String userAgent;
Expand Down Expand Up @@ -71,11 +77,21 @@ public ArtifactoryClientBuilder setPassword(String password) {
return this;
}

/**
* Sets the HTTP connection timeout.
*
* @param connectionTimeout timeout in milliseconds (Apache HttpClient 4.x)
*/
public ArtifactoryClientBuilder setConnectionTimeout(Integer connectionTimeout) {
this.connectionTimeout = connectionTimeout;
return this;
}

/**
* Sets the HTTP socket (read) timeout.
*
* @param socketTimeout timeout in milliseconds (Apache HttpClient 4.x)
*/
public ArtifactoryClientBuilder setSocketTimeout(Integer socketTimeout) {
this.socketTimeout = socketTimeout;
return this;
Expand Down Expand Up @@ -226,10 +242,16 @@ public String getPassword() {
return password;
}

/**
* @return connection timeout in milliseconds, or {@code null} if unset
*/
public Integer getConnectionTimeout() {
return connectionTimeout;
}

/**
* @return socket timeout in milliseconds, or {@code null} if unset
*/
public Integer getSocketTimeout() {
return socketTimeout;
}
Expand Down
Loading