java.lang.Object
edu.internet2.ndt.UserAgentTools
Utility class for parsing user agent strings to extract browser and OS information.
Constructor Summary
ConstructorsConstructorDescriptionThe parsers below are static and hold no configuration, so an instance carries nothing.Method Summary
All Methods
Constructor Details
UserAgentTools
public UserAgentTools()The parsers below are static and hold no configuration, so an instance carries nothing.
Method Details
getArray
Bundle three parsed fields into the fixed-shape result array callers expect.- Parameters:
a- the browser name, or "?" when it could not be determinedb- the browser version, or "?" when it could not be determinedc- the operating system name, or "?" when it could not be determined- Returns:
- a new three-element array holding a, b and c in that order
getBrowser
Extract the browser and OS fields from a User-Agent header.- Parameters:
userAgent- the raw header value, which is ignored here because NDT reports unknown for every field it does not recognize- Returns:
- a three-element array of browser name, browser version and OS name, each "?" when the value is not one NDT knows