Beispiel #1
0
  protected void ignoreDevice(String USN, URL location) {
    // only take note of this if enabled to do so

    if (ignore_bad_devices.getValue()) {

      try {
        PluginConfig pc = plugin_interface.getPluginconfig();

        Map ignored = pc.getPluginMapParameter("upnp.device.ignorelist", new HashMap());

        Map entry = (Map) ignored.get(USN);

        if (entry == null) {

          entry = new HashMap();

          entry.put("Location", location.toString().getBytes());

          ignored.put(USN, entry);

          pc.setPluginMapParameter("upnp.device.ignorelist", ignored);

          updateIgnoreList();

          String text =
              plugin_interface
                  .getUtilities()
                  .getLocaleUtilities()
                  .getLocalisedMessageText(
                      "upnp.ignorebaddevices.alert", new String[] {location.toString()});

          log.logAlertRepeatable(LoggerChannel.LT_WARNING, text);
        }
      } catch (Throwable e) {

        Debug.printStackTrace(e);
      }
    }
  }