public class UserAgentUtil extends Object
Use this class as a last resort when server-side code must be different between browsers.
Modifier and Type | Class and Description |
---|---|
static class |
UserAgentUtil.Browser |
static class |
UserAgentUtil.BrowserFamily |
static class |
UserAgentUtil.BrowserMajorVersion |
static class |
UserAgentUtil.UserAgent |
Constructor and Description |
---|
UserAgentUtil() |
Modifier and Type | Method and Description |
---|---|
static UserAgentUtil.UserAgent |
getCurrentUserAgent()
Retrieves the user agent for the current request.
|
static UserAgentUtil.UserAgent |
getUserAgentInfo(String userAgent)
Parses the User-Agent string from the request header and returns user agent data.
|
static boolean |
isBrowserFamily(UserAgentUtil.BrowserFamily browserFamily)
Checks if the current user agent is in the given browser family.
|
static boolean |
isBrowserMajorVersion(UserAgentUtil.BrowserMajorVersion browserMajorVersion)
Checks if the current user agent is part of the browser family and has the major version of the given version
|
public static boolean isBrowserFamily(@Nonnull UserAgentUtil.BrowserFamily browserFamily)
public static boolean isBrowserMajorVersion(@Nonnull UserAgentUtil.BrowserMajorVersion browserMajorVersion)
public static UserAgentUtil.UserAgent getCurrentUserAgent()
public static UserAgentUtil.UserAgent getUserAgentInfo(String userAgent)
userAgent
- User-Agent string from the request headerCopyright © 2003–2017 Atlassian. All rights reserved.