Esempio n. 1
0
  public synchronized Map<String, Object> getCollections() {
    try {
      Map<String, Object> ret = new LinkedHashMap<String, Object>();
      long nameDirectory_recid = getRoot(NAME_DIRECTORY_ROOT);
      if (nameDirectory_recid == 0) return ret;
      HTree<String, Long> m = fetch(nameDirectory_recid);

      for (Map.Entry<String, Long> e : m.entrySet()) {
        Object o = fetch(e.getValue());
        if (o instanceof BTree) {
          if (((BTree) o).hasValues) o = getTreeMap(e.getKey());
          else o = getTreeSet(e.getKey());
        } else if (o instanceof HTree) {
          if (((HTree) o).hasValues) o = getHashMap(e.getKey());
          else o = getHashSet(e.getKey());
        }

        ret.put(e.getKey(), o);
      }
      return Collections.unmodifiableMap(ret);
    } catch (IOException e) {
      throw new IOError(e);
    }
  }