예제 #1
0
 public static void handleEmblem(final String root, Guilde g) {
   saveImage(root + "/images/emblem/", BattleApiConstants.getEmblemeRing(g));
   saveImage(root + "/images/emblem/", BattleApiConstants.getEmblemeIcon(g.getEmblem()));
   saveImage(root + "/images/emblem/", BattleApiConstants.getEmblemeBorder(g.getEmblem()));
   saveImage(root + "/images/emblem/", BattleApiConstants.getEmblemeBg(g.getEmblem()));
   saveImage(root + "/images/emblem/", BattleApiConstants.getEmblemeOverlay(g.getEmblem()));
   saveImage(root + "/images/emblem/", BattleApiConstants.getEmblemeShadow(g.getEmblem()));
   saveImage(root + "/images/emblem/", BattleApiConstants.getEmblemeHooks());
 }
예제 #2
0
  public static Guilde getGuilde() {
    String readGuildMembersCount = queryBattle(BattleApiConstants.getGuildeMembersQueryUrl());
    LOGGER.debug(readGuildMembersCount);
    if (readGuildMembersCount == null) {
      return null;
    }
    readGuildMembersCount = readGuildMembersCount.substring(readGuildMembersCount.indexOf("(") + 1);
    readGuildMembersCount = readGuildMembersCount.substring(0, readGuildMembersCount.length() - 2);
    Guilde g = new Guilde();
    try {
      ObjectMapper mapper = new ObjectMapper();
      ObjectReader reader = mapper.readerFor(Guilde.class);
      g = reader.readValue(readGuildMembersCount);

      LOGGER.info("Nombre de membres " + g.getMembers().size());
    } catch (Exception e) {
      LOGGER.error(e);
    }
    return g;
  }