|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.wurfl.core.utils.UserAgentUtils
public final class UserAgentUtils
User-Agent helper class.
This class have several utility methods to support the user-agent matching.
| Field Summary | |
|---|---|
static Pattern |
nameSpacePattern
Compiled pattern to parse UAProfile namespace |
static Pattern |
stripQuotePattern
Compiled pattern to strip out quotes in UAProfile |
| Method Summary | |
|---|---|
static String |
getUaProfile(javax.servlet.http.HttpServletRequest request)
This method parse the HTTP request to obtain the UAProf URL. |
static String |
getUserAgent(javax.servlet.http.HttpServletRequest request)
This method parse the Http request to find the user-agent string. |
static boolean |
isBot(String userAgent)
|
static org.apache.commons.collections.Predicate |
isContainedIn(String userAgent)
|
static boolean |
isDesktopBrowser(String userAgent)
|
static boolean |
isMobileBrowser(String userAgent)
|
static boolean |
isXhtmlRequester(javax.servlet.http.HttpServletRequest httpRequest)
This method return true if HTTP request is came from a Xhtml enable device. |
static Set |
keys(String propertyFile)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Pattern stripQuotePattern
public static final Pattern nameSpacePattern
| Method Detail |
|---|
public static String getUserAgent(javax.servlet.http.HttpServletRequest request)
UA request parameter and then across
x-device-user-agent and User-Agent header
value.
request - The HttpServletRequest to parse. It must be not
null value.
public static String getUaProfile(javax.servlet.http.HttpServletRequest request)
It search across the x-wap-profile,Profile
and wap-profile to find the UAProf URL. If this headers
returns a null value it try to obtain right header to read, parsing the
Opt header.
request - The HttpServletRequest parsed to obtain UAProf,
it must be not null.
public static boolean isXhtmlRequester(javax.servlet.http.HttpServletRequest httpRequest)
It parse the accept header to find some keyword, that
demonstrate the device support Xhtml content.
httpRequest - The HttpServletRequest from target device, it
must be not null.
public static Set keys(String propertyFile)
public static boolean isMobileBrowser(String userAgent)
public static boolean isDesktopBrowser(String userAgent)
public static boolean isBot(String userAgent)
public static org.apache.commons.collections.Predicate isContainedIn(String userAgent)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||