code: public String getOS(HttpServletRequest req)
      {
          String strAgent = req.getHeader("user-agent");
          if (strAgent == null)
              return OTHER;
          strAgent = strAgent.toUpperCase();
          for (int i = 0; i < OS.length; i++)
          {
              if (strAgent.indexOf(OS[i][1]) != -1)
                  return OS[i][0];
          }
          return OTHER;
      }
docs: Get the browser type.