mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-04 23:48:42 +01:00
Moved the export paths out of Exporter constructors
This commit is contained in:
parent
c928979f70
commit
618adadfd2
@ -69,10 +69,10 @@ public class NetworkPageExporter extends FileExporter {
|
||||
this.theme = theme;
|
||||
|
||||
exportPaths = new ExportPaths();
|
||||
exportPaths.put("./players", toRelativePathFromRoot("players"));
|
||||
}
|
||||
|
||||
public void export(Path toDirectory, Server server) throws IOException, NotFoundException, ParseException {
|
||||
exportPaths.put("./players", toRelativePathFromRoot("players"));
|
||||
exportRequiredResources(toDirectory);
|
||||
exportJSON(toDirectory, server);
|
||||
exportHtml(toDirectory);
|
||||
|
@ -69,11 +69,11 @@ public class PlayerPageExporter extends FileExporter {
|
||||
this.theme = theme;
|
||||
|
||||
exportPaths = new ExportPaths();
|
||||
exportPaths.put("../network", toRelativePathFromRoot("network"));
|
||||
exportPaths.put("../server", toRelativePathFromRoot("server"));
|
||||
}
|
||||
|
||||
public void export(Path toDirectory, UUID playerUUID, String playerName) throws IOException, NotFoundException, ParseException {
|
||||
exportPaths.put("../network", toRelativePathFromRoot("network"));
|
||||
exportPaths.put("../server", toRelativePathFromRoot("server"));
|
||||
exportRequiredResources(toDirectory);
|
||||
|
||||
Path playerDirectory = toDirectory.resolve("player/" + toFileName(playerName));
|
||||
|
@ -51,6 +51,7 @@ public class PlayersPageExporter extends FileExporter {
|
||||
private final RootJSONHandler jsonHandler;
|
||||
private final Locale locale;
|
||||
private final Theme theme;
|
||||
private final ServerInfo serverInfo;
|
||||
|
||||
private final ExportPaths exportPaths;
|
||||
|
||||
@ -68,12 +69,13 @@ public class PlayersPageExporter extends FileExporter {
|
||||
this.jsonHandler = jsonHandler;
|
||||
this.locale = locale;
|
||||
this.theme = theme;
|
||||
this.serverInfo = serverInfo;
|
||||
|
||||
exportPaths = new ExportPaths();
|
||||
exportPaths.put("/", toRelativePathFromRoot(serverInfo.getServer().isProxy() ? "network" : "server"));
|
||||
}
|
||||
|
||||
public void export(Path toDirectory) throws IOException, NotFoundException, ParseException {
|
||||
exportPaths.put("/", toRelativePathFromRoot(serverInfo.getServer().isProxy() ? "network" : "server"));
|
||||
exportRequiredResources(toDirectory);
|
||||
exportJSON(toDirectory);
|
||||
exportHtml(toDirectory);
|
||||
|
@ -74,10 +74,10 @@ public class ServerPageExporter extends FileExporter {
|
||||
this.serverInfo = serverInfo;
|
||||
|
||||
exportPaths = new ExportPaths();
|
||||
exportPaths.put("../network", toRelativePathFromRoot("network"));
|
||||
}
|
||||
|
||||
public void export(Path toDirectory, Server server) throws IOException, NotFoundException, ParseException {
|
||||
exportPaths.put("../network", toRelativePathFromRoot("network"));
|
||||
exportRequiredResources(toDirectory);
|
||||
exportJSON(toDirectory, server);
|
||||
exportHtml(toDirectory, server);
|
||||
|
Loading…
Reference in New Issue
Block a user