Exemplo n.º 1
0
  static Map getTempContentMap(TOTorrent torrent) {
    if (torrent == null) {
      return new HashMap();
    }

    Map mapAZProps = torrent.getAdditionalMapProperty("attributes");

    if (mapAZProps == null) {
      mapAZProps = new HashMap();
      torrent.setAdditionalMapProperty("attributes", mapAZProps);
    }

    Object objExistingContentMap = mapAZProps.get(TOR_AZ_PROP_MAP);

    Map mapContent;
    if (objExistingContentMap instanceof Map) {
      mapContent = (Map) objExistingContentMap;
    } else {
      mapContent = new HashMap();
      mapAZProps.put(TOR_AZ_PROP_MAP, mapContent);
    }

    return mapContent;
  }
Exemplo n.º 2
0
  public static Map getContentMap(TOTorrent torrent) {
    if (torrent == null) {
      return Collections.EMPTY_MAP;
    }

    Map mapAZProps = torrent.getAdditionalMapProperty(TOTorrent.AZUREUS_PROPERTIES);

    if (mapAZProps == null) {
      mapAZProps = new HashMap();
      torrent.setAdditionalMapProperty(TOTorrent.AZUREUS_PROPERTIES, mapAZProps);
    }

    Object objExistingContentMap = mapAZProps.get(TOR_AZ_PROP_MAP);

    Map mapContent;
    if (objExistingContentMap instanceof Map) {
      mapContent = (Map) objExistingContentMap;
    } else {
      mapContent = new HashMap();
      mapAZProps.put(TOR_AZ_PROP_MAP, mapContent);
    }

    return mapContent;
  }