From 46631c9ae06c9b6e2e0d24f7a8748cf984197289 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 27 Jul 2019 12:01:39 +0300 Subject: [PATCH] Removed /raw/server Affects issues: - #964 --- .../plan/system/export/JSONExport.java | 17 +--------- .../plan/system/webserver/cache/PageId.java | 7 +--- .../webserver/pages/ServerPageHandler.java | 6 ---- .../webserver/response/ResponseFactory.java | 4 --- .../response/pages/RawServerDataResponse.java | 33 ------------------- 5 files changed, 2 insertions(+), 65 deletions(-) delete mode 100644 Plan/common/src/main/java/com/djrapitops/plan/system/webserver/response/pages/RawServerDataResponse.java diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/export/JSONExport.java b/Plan/common/src/main/java/com/djrapitops/plan/system/export/JSONExport.java index ae32747dc..1373b2f1b 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/export/JSONExport.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/export/JSONExport.java @@ -16,11 +16,9 @@ */ package com.djrapitops.plan.system.export; -import com.djrapitops.plan.db.access.queries.objects.ServerQueries; import com.djrapitops.plan.db.access.queries.objects.UserIdentifierQueries; import com.djrapitops.plan.system.database.DBSystem; import com.djrapitops.plan.system.file.PlanFiles; -import com.djrapitops.plan.system.info.server.Server; import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.json.JSONFactory; import com.djrapitops.plan.system.settings.config.PlanConfig; @@ -90,19 +88,6 @@ public class JSONExport extends SpecificExport { } public void exportServerJSON(UUID serverUUID) { - String json = responseFactory.rawServerPageResponse(serverUUID).getContent(); - dbSystem.getDatabase().query(ServerQueries.fetchServerMatchingIdentifier(serverUUID)) - .map(Server::getName) - .ifPresent(serverName -> { - try { - File htmlLocation = getServerFolder(); - htmlLocation.mkdirs(); - File exportFile = new File(htmlLocation, URLEncoder.encode(serverName, "UTF-8") + ".json"); - - export(exportFile, Collections.singletonList(json)); - } catch (IOException e) { - errorHandler.log(L.WARN, this.getClass(), e); - } - }); + // TODO Export JSON Parser results } } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/cache/PageId.java b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/cache/PageId.java index 935135d17..68b269900 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/cache/PageId.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/cache/PageId.java @@ -26,7 +26,6 @@ import java.util.UUID; public enum PageId { SERVER("serverPage:"), - RAW_SERVER("rawServer:"), PLAYER("playerPage:"), RAW_PLAYER("rawPlayer:"), PLAYERS("playersPage"), @@ -38,11 +37,7 @@ public enum PageId { JS("js:"), CSS("css:"), - FAVICON("Favicon"), - - @Deprecated - PLAYER_PLUGINS_TAB("playerPluginsTab:"), - NETWORK_CONTENT("networkContent"); + FAVICON("Favicon"); private final String id; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/pages/ServerPageHandler.java b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/pages/ServerPageHandler.java index f631ae32f..36d5986c0 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/pages/ServerPageHandler.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/pages/ServerPageHandler.java @@ -64,12 +64,6 @@ public class ServerPageHandler implements PageHandler { public Response getResponse(Request request, RequestTarget target) throws WebException { UUID serverUUID = getServerUUID(target); - boolean raw = target.size() >= 2 && target.get(1).equalsIgnoreCase("raw"); - if (raw) { - checkDBState(); - return ResponseCache.loadResponse(PageId.RAW_SERVER.of(serverUUID), () -> responseFactory.rawServerPageResponse(serverUUID)); - } - Response response = ResponseCache.loadResponse(PageId.SERVER.of(serverUUID)); if (response != null) { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/response/ResponseFactory.java b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/response/ResponseFactory.java index ee0aecf3e..83f4aa20b 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/response/ResponseFactory.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/response/ResponseFactory.java @@ -118,10 +118,6 @@ public class ResponseFactory { return new RawPlayerDataResponse(dbSystem.getDatabase().query(ContainerFetchQueries.fetchPlayerContainer(uuid))); } - public RawDataResponse rawServerPageResponse(UUID serverUUID) { - return new RawServerDataResponse(dbSystem.getDatabase().query(ContainerFetchQueries.fetchServerContainer(serverUUID))); - } - public Response javaScriptResponse(String fileName) { try { return new JavaScriptResponse(fileName, files); diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/response/pages/RawServerDataResponse.java b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/response/pages/RawServerDataResponse.java deleted file mode 100644 index 1befb0166..000000000 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/response/pages/RawServerDataResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of Player Analytics (Plan). - * - * Plan is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License v3 as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Plan is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Plan. If not, see . - */ -package com.djrapitops.plan.system.webserver.response.pages; - -import com.djrapitops.plan.data.store.containers.ServerContainer; - -/** - * Raw Data JSON response for a Server. - * - * @author Rsl1122 - * @deprecated Marked for removal in 5.0.0 - */ -@Deprecated -public class RawServerDataResponse extends RawDataResponse { - - public RawServerDataResponse(ServerContainer serverContainer) { - super(serverContainer); - } -} \ No newline at end of file