public class AppiumUserAgentFilter
extends java.lang.Object
implements org.openqa.selenium.remote.http.Filter
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
USER_AGENT
A default User Agent name for Appium Java client.
|
static java.lang.String |
VERSION_KEY |
| Constructor and Description |
|---|
AppiumUserAgentFilter() |
| Modifier and Type | Method and Description |
|---|---|
org.openqa.selenium.remote.http.HttpHandler |
apply(org.openqa.selenium.remote.http.HttpHandler next) |
static java.lang.String |
buildUserAgent(java.lang.String userAgent)
Returns the User Agent.
|
static boolean |
containsAppiumName(java.lang.String userAgent)
Returns true if the given User Agent includes "appium/", which
implies the User Agent already has the Appium UA by this method.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final java.lang.String VERSION_KEY
public static final java.lang.String USER_AGENT
public static boolean containsAppiumName(@Nullable
java.lang.String userAgent)
userAgent - the User Agent in the request headers.public static java.lang.String buildUserAgent(@Nullable
java.lang.String userAgent)
USER_AGENT_PREFIX, it returns the UA.
IF the given UA does not have USER_AGENT_PREFIX,
it returns UA with the Appium prefix.userAgent - the User Agent in the request headers.public org.openqa.selenium.remote.http.HttpHandler apply(org.openqa.selenium.remote.http.HttpHandler next)
apply in interface java.util.function.Function<org.openqa.selenium.remote.http.HttpHandler,org.openqa.selenium.remote.http.HttpHandler>