+ * Note: If you make changes to the object mapper, remember to set it back via
+ * setObjectMapper in order to trigger HTTP client rebuilding.
+ *
null, i.e. using
+ * the system's default tempopary folder.
+ *
+ * @return Temp folder path
+ */
+ public String getTempFolderPath() {
+ return tempFolderPath;
+ }
+
+ /**
+ * Set temp folder path.
+ * @param tempFolderPath Temp folder path
+ * @return API client
+ */
+ public ApiClient setTempFolderPath(String tempFolderPath) {
+ this.tempFolderPath = tempFolderPath;
+ return this;
+ }
+
+ /**
+ * Connect timeout (in milliseconds).
+ * @return Connection timeout
+ */
+ public int getConnectTimeout() {
+ return connectionTimeout;
+ }
+
+ /**
+ * Set the connect timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ * @param connectionTimeout Connection timeout in milliseconds
+ * @return API client
+ */
+ public ApiClient setConnectTimeout(int connectionTimeout) {
+ this.connectionTimeout = connectionTimeout;
+ httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
+ 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
+ */
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ /**
+ * Set the date format used to parse/format date parameters.
+ * @param dateFormat Date format
+ * @return API client
+ */
+ public ApiClient setDateFormat(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ // also set the date format for model (de)serialization with Date properties
+ this.json.setDateFormat((DateFormat) dateFormat.clone());
+ return this;
+ }
+
+ /**
+ * Helper method to configure the token endpoint of the first oauth found in the authentications (there should be only one).
+ * @return
+ */
+ public TokenRequestBuilder getTokenEndPoint() {
+ for(Authentication auth : getAuthentications().values()) {
+ if (auth instanceof OAuth) {
+ OAuth oauth = (OAuth) auth;
+ return oauth.getTokenRequestBuilder();
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * Helper method to configure authorization endpoint of the first oauth found in the authentications (there should be only one).
+ * @return
+ */
+ public AuthenticationRequestBuilder getAuthorizationEndPoint() {
+ for(Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ OAuth oauth = (OAuth) auth;
+ return oauth.getAuthenticationRequestBuilder();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Helper method to configure the OAuth accessCode/implicit flow parameters.
+ * @param clientId OAuth2 client ID
+ * @param clientSecret OAuth2 client secret
+ * @param redirectURI OAuth2 redirect uri
+ */
+ public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) {
+ for(Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ OAuth oauth = (OAuth) auth;
+ oauth.getTokenRequestBuilder()
+ .setClientId(clientId)
+ .setClientSecret(clientSecret)
+ .setRedirectURI(redirectURI);
+ oauth.getAuthenticationRequestBuilder()
+ .setClientId(clientId)
+ .setRedirectURI(redirectURI);
+ return;
+ }
+ }
+ }
+
+ public String getAuthorizationUri() throws OAuthSystemException {
+ return getAuthorizationEndPoint().buildQueryMessage().getLocationUri();
+ }
+
+ /**
+ * Helper method to configure the OAuth accessCode/implicit flow parameters.
+ *
+ * @param clientId OAuth2 client ID: Identifies the client making the request.
+ * Client applications may be scoped to a limited set of system access.
+ * @param scopes the list of requested scopes. Values include {@link OAuth#Scope_SIGNATURE}, {@link OAuth#Scope_EXTENDED}, {@link OAuth#Scope_IMPERSONATION}. You can also pass any advanced scope.
+ * @param redirectUri this determines where to deliver the response containing the authorization code or access token.
+ * @param responseType determines the response type of the authorization request.
+ *