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;
  }
Esempio n. 2
0
 public MarkUp getMarkUp() {
   return device.getMarkUp();
 }
Esempio n. 3
0
 @SuppressWarnings("rawtypes")
 public Map getCapabilities() {
   return device.getCapabilities();
 }
Esempio n. 4
0
 public String getCapability(String name) throws CapabilityNotDefinedException {
   return device.getCapability(name);
 }
Esempio n. 5
0
 public String getUserAgent() {
   return device.getUserAgent();
 }
Esempio n. 6
0
 public String getId() {
   return device.getId();
 }
Esempio n. 7
0
 public boolean isActualDeviceRoot() {
   return device.isActualDeviceRoot();
 }
Esempio n. 8
0
 public String getDeviceRootId() {
   return device.getDeviceRootId();
 }