mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 07:16:09 +00:00
update java petstore samples
This commit is contained in:
@@ -56,6 +56,7 @@ public class ApiClient {
|
||||
protected String basePath = "http://petstore.swagger.io:80/v2";
|
||||
protected boolean debugging = false;
|
||||
protected int connectionTimeout = 0;
|
||||
private int readTimeout = 0;
|
||||
|
||||
protected Client httpClient;
|
||||
protected JSON json;
|
||||
@@ -302,6 +303,27 @@ public class ApiClient {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* read timeout (in milliseconds).
|
||||
* @return Read timeout
|
||||
*/
|
||||
public int getReadTimeout() {
|
||||
return readTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the read timeout (in milliseconds).
|
||||
* A value of 0 means no timeout, otherwise values must be between 1 and
|
||||
* {@link Integer#MAX_VALUE}.
|
||||
* @param readTimeout Read timeout in milliseconds
|
||||
* @return API client
|
||||
*/
|
||||
public ApiClient setReadTimeout(int readTimeout) {
|
||||
this.readTimeout = readTimeout;
|
||||
httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the date format used to parse/format date parameters.
|
||||
* @return Date format
|
||||
|
||||
Reference in New Issue
Block a user