public Device detectDevice(HttpServletRequest request) {
    WURFLManager wurflManager = _wurflHolderImpl.getWURFLManager();

    if (wurflManager == null) {
      if (_log.isWarnEnabled()) {
        _log.warn("WURFL database has not initialized");
      }

      return UnknownDevice.getInstance();
    }

    net.sourceforge.wurfl.core.Device wurflDevice = wurflManager.getDeviceForRequest(request);

    Device device = null;

    if (wurflDevice != null) {
      Map<String, String> capabilities = wurflDevice.getCapabilities();

      if ((capabilities != null) && !capabilities.isEmpty()) {
        device = new WURFLDevice(capabilities, _deviceCapabilityFilter);
      } else {
        device = UnknownDevice.getInstance();
      }
    }

    return device;
  }
Exemplo n.º 2
0
 @SuppressWarnings("rawtypes")
 public Map getCapabilities() {
   return device.getCapabilities();
 }