# UpdateCheckRequest

Import: `import com.install4j.api.update.UpdateCheckRequest;`

```java
public class UpdateCheckRequest
```

An update check request for [`UpdateChecker.getUpdateDescriptor`](UpdateChecker.md#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)
     )
);
```

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getUrlSpec()`](#geturlspec) | `String` | Returns the value set with [`UpdateCheckRequest.urlSpec`](UpdateCheckRequest.md#urlspec-string) |
| [`urlSpec(String)`](#urlspec-string) | `UpdateCheckRequest` | Sets the URL from which the `updates.xml` file can be downloaded. |
| [`getApplicationDisplayMode()`](#getapplicationdisplaymode) | `ApplicationDisplayMode` | Returns the value set with [`UpdateCheckRequest.applicationDisplayMode`](UpdateCheckRequest.md#applicationdisplaymode-applicationdisplaymode) The default value is [`ApplicationDisplayMode.GUI`](ApplicationDisplayMode.md#gui). |
| [`applicationDisplayMode(ApplicationDisplayMode)`](#applicationdisplaymode-applicationdisplaymode) | `UpdateCheckRequest` | Sets the display mode that should be used if proxy information should be required |
| [`getErrorHandlingCallback()`](#geterrorhandlingcallback) | `ErrorHandlingCallback` | Returns the value set with [`UpdateCheckRequest.errorHandlingCallback`](UpdateCheckRequest.md#errorhandlingcallback-errorhandlingcallback) |
| [`errorHandlingCallback(ErrorHandlingCallback)`](#errorhandlingcallback-errorhandlingcallback) | `UpdateCheckRequest` | Sets the callback for handling network errors. |
| [`isAskForProxy()`](#isaskforproxy) | `boolean` |  |
| [`askForProxy(boolean)`](#askforproxy-boolean) | `UpdateCheckRequest` |  |
| [`isShowProxyOnErrorCode()`](#isshowproxyonerrorcode) | `boolean` |  |
| [`showProxyOnErrorCode(boolean)`](#showproxyonerrorcode-boolean) | `UpdateCheckRequest` |  |
| [`getRequestHeaders()`](#getrequestheaders) | `Map<String, List<String>>` | Returns the value set with [`UpdateCheckRequest.requestHeaders`](UpdateCheckRequest.md#requestheaders-map-string-list-string). |
| [`requestHeaders(Map<String, List<String>>)`](#requestheaders-map-string-list-string) | `UpdateCheckRequest` | Sets request headers that should be set for the HTTP connection. |
| [`getConnectTimeout()`](#getconnecttimeout) | `int` | Returns the value set with [`UpdateCheckRequest.connectTimeout`](UpdateCheckRequest.md#connecttimeout-int) The default value is 10000 ms. |
| [`connectTimeout(int)`](#connecttimeout-int) | `UpdateCheckRequest` | Sets the connect timeout in milliseconds for the HTTP connection. |
| [`getReadTimeout()`](#getreadtimeout) | `int` | Returns the value set with [`UpdateCheckRequest.readTimeout`](UpdateCheckRequest.md#readtimeout-int) The default value is 10000 ms. |
| [`readTimeout(int)`](#readtimeout-int) | `UpdateCheckRequest` | Sets the read timeout in milliseconds for the HTTP connection. |
| [`isAcceptAllCertificates()`](#isacceptallcertificates) | `boolean` | Returns the value set with [`UpdateCheckRequest.acceptAllCertificates`](UpdateCheckRequest.md#acceptallcertificates-boolean) |
| [`acceptAllCertificates(boolean)`](#acceptallcertificates-boolean) | `UpdateCheckRequest` | Sets if an HTTPS connection should accept invalid certificates (not recommended for production). |

### getUrlSpec()

```java
public String getUrlSpec()
```

Returns the value set with [`UpdateCheckRequest.urlSpec`](UpdateCheckRequest.md#urlspec-string)


**Returns:** the value

### urlSpec(String)

```java
public UpdateCheckRequest urlSpec(String urlSpec)
```

Sets the URL from which the `updates.xml` file can be downloaded.


**Parameters:**

- `urlSpec` — the url

**Returns:** this instance

### getApplicationDisplayMode()

```java
public ApplicationDisplayMode getApplicationDisplayMode()
```

Returns the value set with [`UpdateCheckRequest.applicationDisplayMode`](UpdateCheckRequest.md#applicationdisplaymode-applicationdisplaymode)
The default value is [`ApplicationDisplayMode.GUI`](ApplicationDisplayMode.md#gui).


**Returns:** the value

### applicationDisplayMode(ApplicationDisplayMode)

```java
public UpdateCheckRequest applicationDisplayMode(ApplicationDisplayMode applicationDisplayMode)
```

Sets the display mode that should be used if proxy information should be required

### getErrorHandlingCallback()

```java
public ErrorHandlingCallback getErrorHandlingCallback()
```

Returns the value set with [`UpdateCheckRequest.errorHandlingCallback`](UpdateCheckRequest.md#errorhandlingcallback-errorhandlingcallback)


**Returns:** the value

### errorHandlingCallback(ErrorHandlingCallback)

```java
public UpdateCheckRequest errorHandlingCallback(ErrorHandlingCallback errorHandlingCallback)
```

Sets the callback for handling network errors. If you return [`ErrorHandlingMode.IGNORE`](../beans/ErrorHandlingMode.md#ignore),
the regular proxy or failure handling will proceed, if you return [`ErrorHandlingMode.CANCEL`](../beans/ErrorHandlingMode.md#cancel)
the action will fail immediately. If you can take corrective action in the script, you can
return [`ErrorHandlingMode.RETRY`](../beans/ErrorHandlingMode.md#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()

```java
@Deprecated public boolean isAskForProxy()
```

> **⚠ Deprecated.**

### askForProxy(boolean)

```java
@Deprecated public UpdateCheckRequest askForProxy(boolean askForProxy)
```

> **⚠ Deprecated.**

### isShowProxyOnErrorCode()

```java
@Deprecated public boolean isShowProxyOnErrorCode()
```

> **⚠ Deprecated.**

### showProxyOnErrorCode(boolean)

```java
@Deprecated public UpdateCheckRequest showProxyOnErrorCode(boolean showProxyOnErrorCode)
```

> **⚠ Deprecated.**

### getRequestHeaders()

```java
public Map<String, List<String>> getRequestHeaders()
```

Returns the value set with [`UpdateCheckRequest.requestHeaders`](UpdateCheckRequest.md#requestheaders-map-string-list-string). The default map is non-null and modifiable.


**Returns:** the value

### requestHeaders(Map<String, List<String>>)

```java
public UpdateCheckRequest requestHeaders(Map<String, List<String>> 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()

```java
public int getConnectTimeout()
```

Returns the value set with [`UpdateCheckRequest.connectTimeout`](UpdateCheckRequest.md#connecttimeout-int)
The default value is 10000 ms.


**Returns:** the value

### connectTimeout(int)

```java
public UpdateCheckRequest connectTimeout(int connectTimeout)
```

Sets the connect timeout in milliseconds for the HTTP connection.


**Parameters:**

- `connectTimeout` — the value in milliseconds

**Returns:** this instance

### getReadTimeout()

```java
public int getReadTimeout()
```

Returns the value set with [`UpdateCheckRequest.readTimeout`](UpdateCheckRequest.md#readtimeout-int)
The default value is 10000 ms.


**Returns:** the value

### readTimeout(int)

```java
public UpdateCheckRequest readTimeout(int readTimeout)
```

Sets the read timeout in milliseconds for the HTTP connection.


**Parameters:**

- `readTimeout` — the value in milliseconds

**Returns:** this instance

### isAcceptAllCertificates()

```java
public boolean isAcceptAllCertificates()
```

Returns the value set with [`UpdateCheckRequest.acceptAllCertificates`](UpdateCheckRequest.md#acceptallcertificates-boolean)


**Returns:** the value

### acceptAllCertificates(boolean)

```java
public UpdateCheckRequest acceptAllCertificates(boolean acceptAllCertificates)
```

Sets if an HTTPS connection should accept invalid certificates (not recommended for production).
The default value is `false`.


**Parameters:**

- `acceptAllCertificates` — the value

**Returns:** this instance

## Constructors

| Signature | Description |
|---|---|
| [`UpdateCheckRequest(String)`](#updatecheckrequest-string) | Constructs an update check request instance. |

### UpdateCheckRequest(String)

```java
public UpdateCheckRequest(String urlSpec)
```

Constructs an update check request instance.


**Parameters:**

- `urlSpec` — the URL from which the `updates.xml` file can be downloaded.

