Package com.install4j.api.update
Class UpdateCheckRequest
java.lang.Object
com.install4j.api.update.UpdateCheckRequest
An update check request for
UpdateChecker.getUpdateDescriptor(UpdateCheckRequest)
.
Only the urlSpec
is mandatory, all other options have a default value that is documented in the setters.
This class is intended to be used in a fluent API invocation style:
UpdateDescriptor updateDescriptor = UpdateChecker.getUpdateDescriptor(
new UpdateCheckRequest("http://test.com/updates.xml").
applicationDisplayMode(ApplicationDisplayMode.CONSOLE).
askForProxy(false).
connectTimeout(50000)
)
);
-
Constructor Summary
ConstructorDescriptionUpdateCheckRequest
(String urlSpec) Constructs an update check request instance. -
Method Summary
Modifier and TypeMethodDescriptionacceptAllCertificates
(boolean acceptAllCertificates) Sets if an HTTPS connection should accept invalid certificates (not recommended for production).applicationDisplayMode
(ApplicationDisplayMode applicationDisplayMode) Sets the display mode that should be used if proxy information should be requiredaskForProxy
(boolean askForProxy) Deprecated.connectTimeout
(int connectTimeout) Sets the connect timeout in milliseconds for the HTTP connection.errorHandlingCallback
(ErrorHandlingCallback errorHandlingCallback) Sets the callback for handling network errors.Returns the value set withapplicationDisplayMode(ApplicationDisplayMode)
The default value isApplicationDisplayMode.GUI
.int
Returns the value set withconnectTimeout(int)
The default value is 10000 ms.Returns the value set witherrorHandlingCallback(ErrorHandlingCallback)
int
Returns the value set withreadTimeout(int)
The default value is 10000 ms.Returns the value set withrequestHeaders(Map)
.Returns the value set withurlSpec(String)
boolean
Returns the value set withacceptAllCertificates(boolean)
boolean
Deprecated.boolean
Deprecated.readTimeout
(int readTimeout) Sets the read timeout in milliseconds for the HTTP connection.requestHeaders
(Map<String, List<String>> requestHeaders) Sets request headers that should be set for the HTTP connection.showProxyOnErrorCode
(boolean showProxyOnErrorCode) Deprecated.Sets the URL from which theupdates.xml
file can be downloaded.
-
Constructor Details
-
UpdateCheckRequest
Constructs an update check request instance.- Parameters:
urlSpec
- the URL from which theupdates.xml
file can be downloaded.
-
-
Method Details
-
getUrlSpec
Returns the value set withurlSpec(String)
- Returns:
- the value
-
urlSpec
Sets the URL from which theupdates.xml
file can be downloaded.- Parameters:
urlSpec
- the url- Returns:
- this instance
-
getApplicationDisplayMode
Returns the value set withapplicationDisplayMode(ApplicationDisplayMode)
The default value isApplicationDisplayMode.GUI
.- Returns:
- the value
-
applicationDisplayMode
Sets the display mode that should be used if proxy information should be required -
getErrorHandlingCallback
Returns the value set witherrorHandlingCallback(ErrorHandlingCallback)
- Returns:
- the value
-
errorHandlingCallback
Sets the callback for handling network errors. If you returnErrorHandlingMode.IGNORE
, the regular proxy or failure handling will proceed, if you returnErrorHandlingMode.CANCEL
the action will fail immediately. If you can take corrective action in the script, you can returnErrorHandlingMode.RETRY
to make the same HTTP request again. However, you have to take special care not to enter an infinite loop. Typically, there should be user input before you retry and the user should be given the option to cancel.The script is only executed for actual network failures, and not if the server or the proxy connection require authentication.
The default value is
null
.- Parameters:
errorHandlingCallback
- the callback- Returns:
- this instance
-
isAskForProxy
Deprecated. -
askForProxy
Deprecated. -
isShowProxyOnErrorCode
Deprecated. -
showProxyOnErrorCode
Deprecated. -
getRequestHeaders
Returns the value set withrequestHeaders(Map)
. The default map is non-null and modifiable.- Returns:
- the value
-
requestHeaders
Sets request headers that should be set for the HTTP connection. The default value is an empty map.- Parameters:
requestHeaders
- the request headers as a map of key-value pairs- Returns:
- this instance
-
getConnectTimeout
public int getConnectTimeout()Returns the value set withconnectTimeout(int)
The default value is 10000 ms.- Returns:
- the value
-
connectTimeout
Sets the connect timeout in milliseconds for the HTTP connection.- Parameters:
connectTimeout
- the value in milliseconds- Returns:
- this instance
-
getReadTimeout
public int getReadTimeout()Returns the value set withreadTimeout(int)
The default value is 10000 ms.- Returns:
- the value
-
readTimeout
Sets the read timeout in milliseconds for the HTTP connection.- Parameters:
readTimeout
- the value in milliseconds- Returns:
- this instance
-
isAcceptAllCertificates
public boolean isAcceptAllCertificates()Returns the value set withacceptAllCertificates(boolean)
- Returns:
- the value
-
acceptAllCertificates
Sets if an HTTPS connection should accept invalid certificates (not recommended for production). The default value isfalse
.- Parameters:
acceptAllCertificates
- the value- Returns:
- this instance
-