mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Removed commands.yml
I also did a few renames as well as a command registration fix.
This commit is contained in:
@ -412,17 +412,17 @@ public class MainUtil {
|
||||
con.setDoOutput(true);
|
||||
con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
|
||||
try (OutputStream output = con.getOutputStream(); PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, StandardCharsets.UTF_8), true)) {
|
||||
String CRLF = "\r\n";
|
||||
writer.append("--" + boundary).append(CRLF);
|
||||
writer.append("Content-Disposition: form-data; name=\"param\"").append(CRLF);
|
||||
writer.append("Content-Type: text/plain; charset=" + StandardCharsets.UTF_8.displayName()).append(CRLF);
|
||||
String crlf = "\r\n";
|
||||
writer.append("--" + boundary).append(crlf);
|
||||
writer.append("Content-Disposition: form-data; name=\"param\"").append(crlf);
|
||||
writer.append("Content-Type: text/plain; charset=" + StandardCharsets.UTF_8.displayName()).append(crlf);
|
||||
String param = "value";
|
||||
writer.append(CRLF).append(param).append(CRLF).flush();
|
||||
writer.append("--" + boundary).append(CRLF);
|
||||
writer.append("Content-Disposition: form-data; name=\"schematicFile\"; filename=\"" + filename + '"').append(CRLF);
|
||||
writer.append("Content-Type: " + URLConnection.guessContentTypeFromName(filename)).append(CRLF);
|
||||
writer.append("Content-Transfer-Encoding: binary").append(CRLF);
|
||||
writer.append(CRLF).flush();
|
||||
writer.append(crlf).append(param).append(crlf).flush();
|
||||
writer.append("--" + boundary).append(crlf);
|
||||
writer.append("Content-Disposition: form-data; name=\"schematicFile\"; filename=\"" + filename + '"').append(crlf);
|
||||
writer.append("Content-Type: " + URLConnection.guessContentTypeFromName(filename)).append(crlf);
|
||||
writer.append("Content-Transfer-Encoding: binary").append(crlf);
|
||||
writer.append(crlf).flush();
|
||||
OutputStream nonClosable = new AbstractDelegateOutputStream(new BufferedOutputStream(output)) {
|
||||
@Override
|
||||
public void close() {
|
||||
@ -431,8 +431,8 @@ public class MainUtil {
|
||||
writeTask.value = nonClosable;
|
||||
writeTask.run();
|
||||
nonClosable.flush();
|
||||
writer.append(CRLF).flush();
|
||||
writer.append("--" + boundary + "--").append(CRLF).flush();
|
||||
writer.append(crlf).flush();
|
||||
writer.append("--" + boundary + "--").append(crlf).flush();
|
||||
}
|
||||
int responseCode = ((HttpURLConnection) con).getResponseCode();
|
||||
String content;
|
||||
|
Reference in New Issue
Block a user