Consolidated all data files to the same location

- Moved all text files that are loaded at runtime to gemp-lotr-cards/src/main/resources
- Updated ApplicationConfiguration (renamed AppConfig) to handle finding text data files based on configuration
- Updated gemp-lotr.properties to contain dev and test versions of the resource path (used for in-IDE execution and JUnit execution, respectively)
- Updated all references to text files to go through AppConfig
This commit is contained in:
Christian 'ketura' McCarty
2022-08-31 01:29:33 -05:00
parent 92205956a9
commit 3aa1eb3e95
451 changed files with 4915 additions and 4800 deletions

View File

@@ -7,6 +7,7 @@ import com.gempukku.lotro.game.CardSets;
import com.gempukku.lotro.packs.PacksStorage;
import com.gempukku.lotro.service.LoggedUserHolder;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
@@ -14,7 +15,7 @@ import java.util.Map;
public class GempukkuServer {
private final Map<Type, Object> context;
public GempukkuServer() {
public GempukkuServer() throws IOException {
Map<Type, Object> objects = new HashMap<>();
final CardSets cardSets = new CardSets();

View File

@@ -1,7 +1,7 @@
package com.gempukku.lotro.async;
import com.gempukku.lotro.async.handler.RootUriRequestHandler;
import com.gempukku.lotro.common.ApplicationConfiguration;
import com.gempukku.lotro.common.AppConfig;
import com.gempukku.polling.LongPollingSystem;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
@@ -20,7 +20,7 @@ import io.netty.handler.logging.LoggingHandler;
public class LotroAsyncServer {
public static void main(String[] server) throws InterruptedException {
int httpPort = Integer.parseInt(ApplicationConfiguration.getProperty("port"));
int httpPort = Integer.parseInt(AppConfig.getProperty("port"));
GempukkuServer gempukkuServer = new GempukkuServer();

View File

@@ -5,7 +5,7 @@ import com.gempukku.lotro.async.HttpProcessingException;
import com.gempukku.lotro.async.ResponseWriter;
import com.gempukku.lotro.cache.CacheManager;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.common.ApplicationConfiguration;
import com.gempukku.lotro.common.AppConfig;
import com.gempukku.lotro.db.LeagueDAO;
import com.gempukku.lotro.db.PlayerDAO;
import com.gempukku.lotro.db.vo.CollectionType;
@@ -21,7 +21,6 @@ import com.gempukku.lotro.service.AdminService;
import com.gempukku.lotro.tournament.TournamentService;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.QueryStringDecoder;
import io.netty.handler.codec.http.multipart.HttpPostRequestDecoder;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -687,10 +686,10 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur
}
}
private void reloadCards(HttpRequest request, ResponseWriter responseWriter) throws HttpProcessingException {
private void reloadCards(HttpRequest request, ResponseWriter responseWriter) throws HttpProcessingException, IOException {
validateAdmin(request);
lotroCardBlueprintLibrary.reloadCards(new java.io.File(ApplicationConfiguration.getProperty("card.path")));
lotroCardBlueprintLibrary.reloadCards(AppConfig.getResourceFile("cards"));
responseWriter.writeHtmlResponse("OK");
}

View File

@@ -2,7 +2,7 @@ package com.gempukku.lotro.async.handler;
import com.gempukku.lotro.async.HttpProcessingException;
import com.gempukku.lotro.async.ResponseWriter;
import com.gempukku.lotro.common.ApplicationConfiguration;
import com.gempukku.lotro.common.AppConfig;
import com.gempukku.polling.LongPollingSystem;
import io.netty.handler.codec.http.HttpRequest;
@@ -39,8 +39,8 @@ public class RootUriRequestHandler implements UriRequestHandler {
private final Pattern originPattern;
public RootUriRequestHandler(Map<Type, Object> context, LongPollingSystem longPollingSystem) {
_webRequestHandler = new WebRequestHandler(ApplicationConfiguration.getProperty("web.path"));
String originAllowedPattern = ApplicationConfiguration.getProperty("origin.allowed.pattern");
_webRequestHandler = new WebRequestHandler(AppConfig.getWebPath());
String originAllowedPattern = AppConfig.getProperty("origin.allowed.pattern");
originPattern = Pattern.compile(originAllowedPattern);
_hallRequestHandler = new HallRequestHandler(context, longPollingSystem);
_deckRequestHandler = new DeckRequestHandler(context);

Some files were not shown because too many files have changed in this diff Show More