Finish gist

This commit is contained in:
2020-10-17 01:20:51 +02:00
parent e4186457e2
commit cb01b7bcb7
51 changed files with 155 additions and 132281 deletions

View File

@@ -1,6 +1,6 @@
package de.jeyp91.tippliga;
import com.google.common.io.Resources;
import de.jeyp91.gists.GistProvider;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.simple.JSONArray;
@@ -8,9 +8,6 @@ import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
public class TLWMatchesCreatorTipperPokal extends TLWMatchesCreatorBase{
@@ -30,21 +27,21 @@ public class TLWMatchesCreatorTipperPokal extends TLWMatchesCreatorBase{
this.league = league;
this.matchdays = matchdays;
URL tipperListUrl = Resources.getResource(season + "\\" + configFileName);
URL tipperTeamConfigUrl = Resources.getResource("Tipper_Team_Config.json");
GistProvider prov = GistProvider.getInstance();
this.TLWMatches = new ArrayList<>();
try {
JSONParser jsonParser = new JSONParser();
String tipperListString = Resources.toString(tipperListUrl, StandardCharsets.UTF_8);
String tipperListString = prov.getTippligaConfig(season, configFileName);
this.tipperList = (JSONObject) jsonParser.parse(tipperListString);
String tipperTeamConfigString = Resources.toString(tipperTeamConfigUrl, StandardCharsets.UTF_8);
String tipperTeamConfigString = prov.getTippligaBaseConfig("Tipper_Team_Config.json");
this.tipperTeamConfig = (JSONArray) jsonParser.parse(tipperTeamConfigString);
} catch (IOException | ParseException e) {
} catch (ParseException e) {
e.printStackTrace();
}