2.9.3 (latest) 2.9.2 2.8.1 2.7.2 2.6.0 2.5.1 2.4.1 2.1.2 2.0.1 1.35.2 1.34.1 1.33.4

```java
public final class WebhookUtils
```
Beta   

Utilities for Webhook notifications using the `jakarta.servlet` namespace.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> WebhookUtils

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### TYPE

```java
public static final String TYPE
```
Webhook notification channel type to use in the watch request.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `String` |   |

## Static Methods

### processWebhookNotification(HttpServletRequest req, HttpServletResponse resp, DataStore\<StoredChannel\> channelDataStore)

```java
public static void processWebhookNotification(HttpServletRequest req, HttpServletResponse resp, DataStore<StoredChannel> channelDataStore)
```
Utility method to process the webhook notification from HttpServlet#doPost.

The HttpServletRequest#getInputStream() is closed in a finally block inside this
method. If it is not detected to be a webhook notification, an HttpServletResponse#SC_BAD_REQUEST error will be displayed. If the notification channel is
found in the given notification channel data store, it will call [UnparsedNotificationCallback#onNotification](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.UnparsedNotificationCallback.md.txt#com_google_api_client_googleapis_notifications_UnparsedNotificationCallback_onNotification_) for the registered notification callback method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `req` | `jakarta.servlet.http.HttpServletRequest` an HttpServletRequest object that contains the request the client has made of the servlet |
| `resp` | `jakarta.servlet.http.HttpServletResponse` an HttpServletResponse object that contains the response the servlet sends to the client |
| `channelDataStore` | `com.google.api.client.util.store.DataStore<StoredChannel>` notification channel data store |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `jakarta.servlet.ServletException` |   |
| `IOException` |   |

### processWebhookNotification(HttpServletRequest req, HttpServletResponse resp, DataStoreFactory dataStoreFactory)

```java
public static void processWebhookNotification(HttpServletRequest req, HttpServletResponse resp, DataStoreFactory dataStoreFactory)
```
Utility method to process the webhook notification from HttpServlet#doPost by finding
the notification channel in the given data store factory.

It is a wrapper around #processWebhookNotification(HttpServletRequest, HttpServletResponse, DataStore) that uses the data store from [StoredChannel#getDefaultDataStore(DataStoreFactory)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.StoredChannel.md.txt#com_google_api_client_googleapis_notifications_StoredChannel_getDefaultDataStore_com_google_api_client_util_store_DataStoreFactory_).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `req` | `jakarta.servlet.http.HttpServletRequest` an HttpServletRequest object that contains the request the client has made of the servlet |
| `resp` | `jakarta.servlet.http.HttpServletResponse` an HttpServletResponse object that contains the response the servlet sends to the client |
| `dataStoreFactory` | `com.google.api.client.util.store.DataStoreFactory` data store factory |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `jakarta.servlet.ServletException` |   |
| `IOException` |   |