Exemplo n.º 1
0
 private void checkShowFreeDialog() {
   SubConfiguration config = null;
   try {
     config = getPluginConfig();
     if (config.getBooleanProperty("premAdShown", Boolean.FALSE) == false) {
       if (config.getProperty("premAdShown2") == null) {
         File checkFile = JDUtilities.getResourceFile("tmp/cldzn");
         if (!checkFile.exists()) {
           checkFile.mkdirs();
           showFreeDialog("cloudzer.net");
         }
       } else {
         config = null;
       }
     } else {
       config = null;
     }
   } catch (final Throwable e) {
   } finally {
     if (config != null) {
       config.setProperty("premAdShown", Boolean.TRUE);
       config.setProperty("premAdShown2", "shown");
       config.save();
     }
   }
 }
Exemplo n.º 2
0
  /**
   * converts from old subconfig to new JSOnstorage
   *
   * @param string
   * @param ret
   */
  private static void convert(String string, JSonWrapper ret) {
    SubConfiguration subConfig = SubConfiguration.getConfig(string);
    HashMap<String, Object> props = subConfig.getProperties();
    if (props != null && props.size() > 0) {
      Entry<String, Object> next;
      for (Iterator<Entry<String, Object>> it = props.entrySet().iterator(); it.hasNext(); ) {
        next = it.next();
        try {
          ret.setProperty(next.getKey(), next.getValue());
        } catch (Throwable e) {
          Log.exception(e);
        }
        it.remove();
      }

      subConfig.setProperties(props);
      subConfig.save();
      ret.save();
    }
  }