|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.filenet.wcm.toolkit.server.util.UserAgent
UserAgent is a class representing the User-Agent header found on an incoming HTTP request object. An object of this class, therefore, requires a User-Agent string for construction. This string is parsed down, and provides accessors for browser name, browser version and boolean flags indicating certain things that the browser supports. UserAgents are created via a static factory method that caches UserAgent objects based on the user agent string that was used to construct them. This way, parsing of a given user agent string only needs to be done once per JVM process invocation. In the static initializer block, one or more Maps can be defined representing different browser capabilities. Entries can then be added with key==browser name and value==browser version. boolean flags are then set for each corresponding map, depending on whether or not there is a browser name hit in the map, and the version is greater than or equal to the browser version value found in the map.
Field Summary | |
protected static java.util.Map |
activeXBrowserMap
|
protected static java.util.Map |
activeXOSMap
|
protected boolean |
addsExtraLinefeeds
|
protected static java.util.Map |
addsExtraLinefeedsMap
|
protected static java.util.Map |
agentCache
|
protected static java.util.Map |
encodedFilenameMap
|
protected static java.util.Map |
inputTypeFileMap
|
protected java.lang.String |
name
|
protected java.lang.String |
osName
|
protected java.lang.String |
osVersion
|
protected static java.util.Set |
recognizedBrowsers
|
protected static java.util.Map |
rfc2231Map
|
protected java.lang.String |
rName
|
protected java.lang.String |
rVersion
|
protected boolean |
supportsActiveX
|
protected boolean |
supportsEncodedFilename
|
protected boolean |
supportsInputTypeFile
|
protected boolean |
supportsRFC2231
|
protected java.util.List |
tokens
|
static java.lang.String |
USER_AGENT
|
protected java.lang.String |
version
|
Method Summary | |
boolean |
addsExtraLinefeeds()
|
protected int |
compareVersions(java.lang.String version1,
java.lang.String version2)
Compare version strings. |
java.lang.String |
getName()
Returns the identified browser's name. |
static UserAgent |
getUserAgent(javax.servlet.http.HttpServletRequest request)
Static factory convenience signature that thakes the request object as input. |
static UserAgent |
getUserAgent(java.lang.String userAgentHeader)
Static factory method. |
java.lang.String |
getVersion()
Returns the identified browser's version String. |
boolean |
hasActiveXSupport()
Returns true if the client machine's operating system and browser type/version are the proper type to support File Tracking through the Workplace FileTracker Active-X control |
boolean |
hasEncodedFilenameSupport()
Returns true if the browser can accept a URL/UTF-8 encoded filename interchangeably with a clear text filename in the Content-Disposition header. |
boolean |
hasInputTypeFileSupport()
|
boolean |
hasRFC2231Support()
Returns true if the browser supports rfc2231 Content-Disposition headers. |
protected void |
initialize(java.lang.String userAgent)
Initializes the UserAgent object. |
protected void |
setFlags()
Configure all of the boolean flags in this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String USER_AGENT
protected static java.util.Map agentCache
protected static java.util.Set recognizedBrowsers
protected static java.util.Map rfc2231Map
protected static java.util.Map encodedFilenameMap
protected static java.util.Map addsExtraLinefeedsMap
protected static java.util.Map inputTypeFileMap
protected static java.util.Map activeXBrowserMap
protected static java.util.Map activeXOSMap
protected java.util.List tokens
protected java.lang.String name
protected java.lang.String version
protected java.lang.String rName
protected java.lang.String rVersion
protected java.lang.String osName
protected java.lang.String osVersion
protected boolean supportsRFC2231
protected boolean supportsEncodedFilename
protected boolean addsExtraLinefeeds
protected boolean supportsInputTypeFile
protected boolean supportsActiveX
Method Detail |
public static UserAgent getUserAgent(javax.servlet.http.HttpServletRequest request)
request
-
public static UserAgent getUserAgent(java.lang.String userAgentHeader)
userAgentHeader
-
public java.lang.String getName()
public java.lang.String getVersion()
public boolean hasRFC2231Support()
public boolean hasEncodedFilenameSupport()
public boolean hasInputTypeFileSupport()
public boolean addsExtraLinefeeds()
public boolean hasActiveXSupport()
protected void initialize(java.lang.String userAgent)
userAgent
- protected void setFlags()
protected int compareVersions(java.lang.String version1, java.lang.String version2)
version1
- version2
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |