Package org.silverpeas.core.web.util
Class ClientBrowserUtil
- java.lang.Object
-
- org.silverpeas.core.web.util.ClientBrowserUtil
-
public class ClientBrowserUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
CHROME
static Pattern
FREEBSD
static Pattern
KONQUEROR
static Pattern
LINUX
static Pattern
MAC
static Pattern
MICROSOFT
static Pattern
MOZILLA
static Pattern
MOZILLA_LIKE
static Pattern
MSIE
static Pattern
OPERA
static Pattern
SAFARI
static Pattern
UNIX
static Pattern
WINDOWS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getUserAgent(javax.servlet.http.HttpServletRequest request)
static boolean
isChrome(String userAgent)
static boolean
isChrome(javax.servlet.http.HttpServletRequest request)
static boolean
isFirefox(String userAgent)
Returns true if the user-agent indicates a Firefox browser.static boolean
isFirefox(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates a Firefox browser.static boolean
isInternetExplorer(String userAgent)
static boolean
isInternetExplorer(javax.servlet.http.HttpServletRequest request)
static boolean
isKonqueror(String userAgent)
static boolean
isKonqueror(javax.servlet.http.HttpServletRequest request)
static boolean
isMacintosh(String userAgent)
Returns true if the user-agent indicates MacOSX.static boolean
isMacintosh(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates MacOSX.static boolean
isOpera(String userAgent)
static boolean
isOpera(javax.servlet.http.HttpServletRequest request)
static boolean
isSafari(String userAgent)
Returns true if the user-agent indicates a Safari browser.static boolean
isSafari(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates a Safari browser.static boolean
isUnix(String userAgent)
Returns true if the user-agent indicates Unix.static boolean
isUnix(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates Unix.static boolean
isWindows(String userAgent)
Returns true if the user-agent indicates Windows.static boolean
isWindows(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates Windows.static String
rfc2047EncodeFilename(String userAgent, String filename)
static String
rfc2047EncodeFilename(javax.servlet.http.HttpServletRequest request, String filename)
-
-
-
Field Detail
-
MOZILLA
public static final Pattern MOZILLA
-
MOZILLA_LIKE
public static final Pattern MOZILLA_LIKE
-
CHROME
public static final Pattern CHROME
-
MSIE
public static final Pattern MSIE
-
MICROSOFT
public static final Pattern MICROSOFT
-
OPERA
public static final Pattern OPERA
-
SAFARI
public static final Pattern SAFARI
-
KONQUEROR
public static final Pattern KONQUEROR
-
LINUX
public static final Pattern LINUX
-
WINDOWS
public static final Pattern WINDOWS
-
MAC
public static final Pattern MAC
-
FREEBSD
public static final Pattern FREEBSD
-
UNIX
public static final Pattern UNIX
-
-
Method Detail
-
isWindows
public static boolean isWindows(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates Windows.- Parameters:
request
-- Returns:
- true if the user-agent indicates Windows.
-
isWindows
public static boolean isWindows(String userAgent)
Returns true if the user-agent indicates Windows.- Parameters:
userAgent
- the request User-Agent header.- Returns:
- true if the user-agent indicates Windows.
-
isMacintosh
public static boolean isMacintosh(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates MacOSX.- Parameters:
request
-- Returns:
- true if the user-agent indicates MacOSX.
-
isMacintosh
public static boolean isMacintosh(String userAgent)
Returns true if the user-agent indicates MacOSX.- Parameters:
userAgent
- the request User-Agent header.- Returns:
- true if the user-agent indicates MacOSX.
-
isUnix
public static boolean isUnix(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates Unix.- Parameters:
request
-- Returns:
- true if the user-agent indicates Unix.
-
isUnix
public static boolean isUnix(String userAgent)
Returns true if the user-agent indicates Unix.- Parameters:
userAgent
- the request User-Agent header.- Returns:
- true if the user-agent indicates Unix.
-
isFirefox
public static boolean isFirefox(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates a Firefox browser.- Parameters:
request
-- Returns:
- true if the user-agent indicates a Firefox browser..
-
isFirefox
public static boolean isFirefox(String userAgent)
Returns true if the user-agent indicates a Firefox browser.- Parameters:
userAgent
- the request User-Agent header.- Returns:
- true if the user-agent indicates a Firefox browser..
-
isSafari
public static boolean isSafari(javax.servlet.http.HttpServletRequest request)
Returns true if the user-agent indicates a Safari browser.- Parameters:
request
-- Returns:
- true if the user-agent indicates a Safari browser..
-
isSafari
public static boolean isSafari(String userAgent)
Returns true if the user-agent indicates a Safari browser.- Parameters:
userAgent
- the request User-Agent header.- Returns:
- true if the user-agent indicates a Safari browser..
-
isChrome
public static boolean isChrome(javax.servlet.http.HttpServletRequest request)
- Parameters:
request
-- Returns:
-
isChrome
public static boolean isChrome(String userAgent)
- Parameters:
userAgent
-- Returns:
-
isOpera
public static boolean isOpera(javax.servlet.http.HttpServletRequest request)
- Parameters:
request
-- Returns:
-
isOpera
public static boolean isOpera(String userAgent)
- Parameters:
userAgent
-- Returns:
-
isInternetExplorer
public static boolean isInternetExplorer(javax.servlet.http.HttpServletRequest request)
- Parameters:
request
-- Returns:
-
isInternetExplorer
public static boolean isInternetExplorer(String userAgent)
- Parameters:
userAgent
-- Returns:
-
isKonqueror
public static boolean isKonqueror(javax.servlet.http.HttpServletRequest request)
- Parameters:
request
-- Returns:
-
isKonqueror
public static boolean isKonqueror(String userAgent)
- Parameters:
userAgent
-- Returns:
-
getUserAgent
public static String getUserAgent(javax.servlet.http.HttpServletRequest request)
- Parameters:
request
-- Returns:
-
rfc2047EncodeFilename
public static String rfc2047EncodeFilename(javax.servlet.http.HttpServletRequest request, String filename)
- Parameters:
request
-filename
-- Returns:
-
-