Ejemplo n.º 1
0
  public void printValuesTable() {
    if (valuesTable != null) {
      for (HashMapIterator hashmapiterator = valuesTable.begin();
          !hashmapiterator.atEnd();
          hashmapiterator.advance()) {
        System.out.println(hashmapiterator.key() + "=" + hashmapiterator.value());
      }

    } else {
      System.out.println("No values");
    }
  }
Ejemplo n.º 2
0
  /**
   * CAUTION: Decompiled by hand.
   *
   * @param hashmap
   * @param hashmap1
   * @param flag
   */
  public void initializeValuesTable(HashMap hashmap, HashMap hashmap1, boolean flag) {
    for (HashMapIterator hashmapiterator = hashmap.begin();
        !hashmapiterator.atEnd();
        hashmapiterator.advance()) {
      String s = (String) hashmapiterator.key();
      Object obj = hashmapiterator.value();
      StringProperty stringproperty = getPropertyObject(s);
      if (stringproperty != null) {
        if (!stringproperty.onPlatform(getPlatform())) {
          continue;
        }
        if (flag) {
          hashmap1.remove(stringproperty);
        }
        if (obj instanceof Array) {
          for (Enumeration enumeration = ((Array) obj).elements();
              enumeration.hasMoreElements();
              hashmap1.add(stringproperty, enumeration.nextElement())) ;
        } else {
          hashmap1.add(stringproperty, obj);
        }
        continue;
      }
      if (flag) {
        hashmap1.remove(s);
      }

      if (obj instanceof Array) {
        Enumeration enumeration1 = ((Array) obj).elements();
        while (enumeration1.hasMoreElements()) {
          Object obj1 = enumeration1.nextElement();
          if ((obj1 instanceof String)) {
            hashmap1.add(s, obj1);
          }
        }
      } else if (obj instanceof String) {
        hashmap1.add(s, obj);
      }
    }
  }
  public synchronized boolean execute() {
    try {
      SiteViewGroup siteviewgroup = SiteViewGroup.currentSiteView();
      Array array = new Array();
      Array array1 = new Array();
      Array array2 = new Array();
      Array array3 = siteviewgroup.getGroupFiles();
      Enumeration enumeration = array3.elements();
      File file = null;
      File file1 = null;
      File file2 = null;
      File file3 = null;
      HashSet hashset = new HashSet();
      for (Enumeration enumeration1 = fileNameMap.keys();
          enumeration1.hasMoreElements();
          hashset.add(enumeration1.nextElement())) {}
      String s;
      for (; enumeration.hasMoreElements(); hashset.remove(s)) {
        File file4 = (File) enumeration.nextElement();
        s = file4.getAbsolutePath();
        Long long1 = (Long) fileNameMap.get(s);
        if (long1 == null) {
          if (file4.getName().equals("history.config")) {
            file = file4;
          } else if (file4.getName().equals("dynamic.config")) {
            file2 = file4;
          } else {
            array.add(file4);
          }
        } else if (long1.longValue() != file4.lastModified()) {
          if (file4.getName().equals("history.config")) {
            file1 = file4;
          } else if (file4.getName().equals("dynamic.config")) {
            file3 = file4;
          } else {
            array1.add(file4);
            if (file4.getAbsolutePath().endsWith(".mg")) {
              //                            TopazConfigurator.checkModified(file4);
            }
          }
        }
        long1 = new Long(file4.lastModified());
        fileNameMap.put(s, long1);
      }

      if (file2 != null) {
        array.add(file2);
      }
      if (file3 != null) {
        array1.add(file3);
      }
      if (file != null) {
        array.add(file);
      }
      if (file1 != null) {
        array1.add(file1);
      }
      String s1;
      for (Iterator iterator = hashset.iterator();
          iterator.hasNext();
          LogManager.log("Debug", "group deleted: " + s1)) {
        s1 = (String) iterator.next();
        fileNameMap.remove(s1);
        File file5 = new File(s1);
        array2.add(file5);
        if (file5.getAbsolutePath().endsWith(".mg")) {
          //                    TopazConfigurator.checkDeleted(file5);
        }
      }

      HashMap hashmap = new HashMap();
      siteviewgroup.adjustGroups(array, array1, array2, hashmap);
      for (HashMapIterator hashmapiterator = hashmap.begin();
          !hashmapiterator.atEnd();
          hashmapiterator.advance()) {
        fileNameMap.put(hashmapiterator.key(), hashmapiterator.value());
      }

    } catch (Exception exception) {
      LogManager.log("Error", "Error loading configuration: " + exception);
      LogManager.log("Error", "  detail: " + FileUtils.stackTraceText(exception));
    }
    clearConfigChangeFlag();
    return true;
  }