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