コード例 #1
0
  public CSV(Tournament t, Round r) {
    properties = TournamentProperties.getProperties();
    separator = ";" + System.getProperty("line.separator");
    logLocation = properties.getProperty("logLocation");
    baseUrl = properties.getProperty("actionIndex.logUrl", "download?game=%d");
    baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf("game"));

    if (t != null) {
      String name = "%stournament.%s.csv";
      String levels = "%srounds.%s.csv";
      names =
          new String[] {
            String.format(name, logLocation, t.getTournamentName().replaceAll(" ", "_")),
            String.format(name, logLocation, t.getTournamentId()),
            String.format(levels, logLocation, t.getTournamentName().replaceAll(" ", "_")),
            String.format(levels, logLocation, t.getTournamentId())
          };
    } else if (r != null) {
      String name = "%sround.%s.csv";
      String games = "%sgames.%s.csv";
      names =
          new String[] {
            String.format(name, logLocation, r.getRoundName().replaceAll(" ", "_")),
            String.format(name, logLocation, r.getRoundId()),
            String.format(games, logLocation, r.getRoundName().replaceAll(" ", "_")),
            String.format(games, logLocation, r.getRoundId())
          };
    }
  }