org.loom.servlet
Class BrowserData

java.lang.Object
  extended by org.loom.servlet.BrowserData

public class BrowserData
extends java.lang.Object

Contains the browser data that can be guessed from the User-Agent header. Keep in mind that the user can modify the User-Agent string, so BrowserData is not 100% bulletproof. To be sure you should be using javascript instead. For examples of User-Agent header values, see http://www.zytrax.com/tech/web/browser_ids.htm http://www.user-agents.org/index.shtml


Constructor Summary
BrowserData(java.lang.String userAgent)
           
 
Method Summary
 java.lang.String getUserAgent()
           
 java.lang.String getVersion()
           
 boolean isGecko()
           
 boolean isIE()
           
 boolean isVersionLessThan(java.lang.String version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserData

public BrowserData(java.lang.String userAgent)
Method Detail

isIE

public boolean isIE()
Returns:
true if the browser is a IE

isGecko

public boolean isGecko()
Returns:
true if the browser is Firefox or any other Gecko-based browser

getVersion

public java.lang.String getVersion()
Returns:
the version number if it could be extracted, else return an empty String.

isVersionLessThan

public boolean isVersionLessThan(java.lang.String version)
Returns:
true if the browser version is less than the provided version, or false if the version number could not be guessed.

getUserAgent

public java.lang.String getUserAgent()