Removed commands.yml

I also did a few renames as well as a command registration fix.
This commit is contained in:
MattBDev
2019-07-26 19:23:24 -04:00
parent 9a4473b73f
commit 7963b2c92f
19 changed files with 121 additions and 304 deletions

View File

@ -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;