mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-10 01:14:39 +00:00
Fix uploader
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.jpexs.uploader;
|
||||
|
||||
import java.awt.Dimension;
|
||||
@@ -61,9 +56,9 @@ public class Uploader {
|
||||
httpConn.setUseCaches(false);
|
||||
httpConn.setDoOutput(true); // indicates POST method
|
||||
httpConn.setDoInput(true);
|
||||
httpConn.setRequestProperty("User-Agent", "JPEXS Uploader");
|
||||
httpConn.setRequestProperty("Content-Type",
|
||||
"multipart/form-data; boundary=" + boundary);
|
||||
httpConn.setRequestProperty("User-Agent", "JPEXS Uploader");
|
||||
outputStream = httpConn.getOutputStream();
|
||||
writer = new PrintWriter(new OutputStreamWriter(outputStream, charset),
|
||||
true);
|
||||
@@ -122,17 +117,6 @@ public class Uploader {
|
||||
writer.flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a header field to the request.
|
||||
*
|
||||
* @param name - name of the header field
|
||||
* @param value - value of the header field
|
||||
*/
|
||||
public void addHeaderField(String name, String value) {
|
||||
writer.append(name + ": " + value).append(LINE_FEED);
|
||||
writer.flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* Completes the request and receives response from the server.
|
||||
*
|
||||
@@ -248,9 +232,6 @@ public class Uploader {
|
||||
|
||||
try {
|
||||
MultipartUtility multipart = new MultipartUtility(requestURL, charset);
|
||||
|
||||
multipart.addHeaderField("User-Agent", "JPEXS Uploader");
|
||||
|
||||
for (int i = 0; i < types.size(); i++) {
|
||||
if (types.get(i).equals("field")) {
|
||||
multipart.addFormField(names.get(i), values.get(i));
|
||||
@@ -272,7 +253,6 @@ public class Uploader {
|
||||
}
|
||||
System.exit(ok ? 0 : 1);
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
uploader.jar
BIN
uploader.jar
Binary file not shown.
Reference in New Issue
Block a user