diff --git a/src/main/java/dev/plex/HTTPDModule.java b/src/main/java/dev/plex/HTTPDModule.java index eb74f7b..f837053 100644 --- a/src/main/java/dev/plex/HTTPDModule.java +++ b/src/main/java/dev/plex/HTTPDModule.java @@ -8,7 +8,8 @@ import dev.plex.request.impl.IndefBansEndpoint; import dev.plex.request.impl.IndexEndpoint; import dev.plex.request.impl.ListEndpoint; import dev.plex.request.impl.PunishmentsEndpoint; -import dev.plex.request.impl.SchematicEndpoint; +import dev.plex.request.impl.SchematicDownloadEndpoint; +import dev.plex.request.impl.SchematicUploadEndpoint; import dev.plex.util.PlexLog; import java.util.concurrent.atomic.AtomicReference; import lombok.Getter; @@ -71,7 +72,8 @@ public class HTTPDModule extends PlexModule new IndexEndpoint(); new ListEndpoint(); new PunishmentsEndpoint(); - new SchematicEndpoint(); + new SchematicDownloadEndpoint(); + new SchematicUploadEndpoint(); server.setConnectors(new Connector[]{connector}); server.setHandler(context); diff --git a/src/main/java/dev/plex/request/impl/SchematicEndpoint.java b/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java similarity index 92% rename from src/main/java/dev/plex/request/impl/SchematicEndpoint.java rename to src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java index 1b4ed3d..997a4e9 100644 --- a/src/main/java/dev/plex/request/impl/SchematicEndpoint.java +++ b/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java @@ -11,10 +11,10 @@ import java.io.OutputStream; import java.util.Arrays; import org.bukkit.Bukkit; -public class SchematicEndpoint extends AbstractServlet +public class SchematicDownloadEndpoint extends AbstractServlet { - @GetMapping(endpoint = "/api/download_schematic/") - public String schematicIndex(HttpServletRequest request, HttpServletResponse response) + @GetMapping(endpoint = "/api/schematics/download/") + public String downloadSchematic(HttpServletRequest request, HttpServletResponse response) { if (request.getPathInfo() == null || request.getPathInfo().equals("/")) { @@ -79,7 +79,7 @@ public class SchematicEndpoint extends AbstractServlet private String schematicHTML() { - String file = readFile(this.getClass().getResourceAsStream("/httpd/schematic_list.html")); + String file = readFile(this.getClass().getResourceAsStream("/httpd/schematic_download.html")); File worldeditFolder = getWorldeditFolder(); if (worldeditFolder == null) { diff --git a/src/main/java/dev/plex/request/impl/SchematicUploadEndpoint.java b/src/main/java/dev/plex/request/impl/SchematicUploadEndpoint.java new file mode 100644 index 0000000..0ee23f2 --- /dev/null +++ b/src/main/java/dev/plex/request/impl/SchematicUploadEndpoint.java @@ -0,0 +1,15 @@ +package dev.plex.request.impl; + +import dev.plex.request.AbstractServlet; +import dev.plex.request.GetMapping; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +public class SchematicUploadEndpoint extends AbstractServlet +{ + @GetMapping(endpoint = "/api/schematics/upload/") + public String downloadSchematic(HttpServletRequest request, HttpServletResponse response) + { + return readFile(this.getClass().getResourceAsStream("/httpd/schematic_upload.html")); + } +} diff --git a/src/main/resources/httpd/admins.html b/src/main/resources/httpd/admins.html index dbbec3c..90e6133 100644 --- a/src/main/resources/httpd/admins.html +++ b/src/main/resources/httpd/admins.html @@ -40,8 +40,8 @@ Schematics diff --git a/src/main/resources/httpd/indefbans.html b/src/main/resources/httpd/indefbans.html index b82dbf7..c09ed8e 100644 --- a/src/main/resources/httpd/indefbans.html +++ b/src/main/resources/httpd/indefbans.html @@ -40,8 +40,8 @@ Schematics diff --git a/src/main/resources/httpd/index.html b/src/main/resources/httpd/index.html index be75ef6..d1a8efd 100644 --- a/src/main/resources/httpd/index.html +++ b/src/main/resources/httpd/index.html @@ -40,8 +40,8 @@ Schematics diff --git a/src/main/resources/httpd/punishments.html b/src/main/resources/httpd/punishments.html index c373b71..ab3d3df 100644 --- a/src/main/resources/httpd/punishments.html +++ b/src/main/resources/httpd/punishments.html @@ -40,8 +40,8 @@ Schematics diff --git a/src/main/resources/httpd/punishments_error.html b/src/main/resources/httpd/punishments_error.html index a7e51ca..e1b22b1 100644 --- a/src/main/resources/httpd/punishments_error.html +++ b/src/main/resources/httpd/punishments_error.html @@ -40,8 +40,8 @@ Schematics diff --git a/src/main/resources/httpd/punishments_good.html b/src/main/resources/httpd/punishments_good.html index faad4fb..43ec513 100644 --- a/src/main/resources/httpd/punishments_good.html +++ b/src/main/resources/httpd/punishments_good.html @@ -39,8 +39,8 @@ Schematics diff --git a/src/main/resources/httpd/schematic_list.html b/src/main/resources/httpd/schematic_download.html similarity index 92% rename from src/main/resources/httpd/schematic_list.html rename to src/main/resources/httpd/schematic_download.html index 0b9cca1..fd36384 100644 --- a/src/main/resources/httpd/schematic_list.html +++ b/src/main/resources/httpd/schematic_download.html @@ -34,13 +34,14 @@ diff --git a/src/main/resources/httpd/schematic_upload.html b/src/main/resources/httpd/schematic_upload.html new file mode 100644 index 0000000..e8c3e7d --- /dev/null +++ b/src/main/resources/httpd/schematic_upload.html @@ -0,0 +1,55 @@ + + + + + + + Schematics - Plex HTTPD + + + +
+

Plex HTTPD

+
Page coming soon.
+
+ + \ No newline at end of file