Added GuiProgressBar and implemented it in GuiUploadFile

Fixed incorrect success messages in GuiUploadFile
This commit is contained in:
CrushedPixel
2015-05-29 13:22:04 +02:00
parent d986db7c95
commit 8efcf0bb29
5 changed files with 124 additions and 30 deletions

View File

@@ -112,20 +112,20 @@ public class FileUploader {
success = true;
is = con.getInputStream();
} else {
success = false;
is = con.getErrorStream();
}
if(is != null) {
BufferedReader r = new BufferedReader(new InputStreamReader(is));
info = null;
String result = "";
while(r.ready()) {
result += r.readLine();
}
if(responseCode != 200) {
String json = "";
while(r.ready()) {
json += r.readLine();
}
ApiError error = gson.fromJson(json, ApiError.class);
ApiError error = gson.fromJson(result, ApiError.class);
info = error.getTranslatedDesc();
System.out.println(info);
}
}
con.disconnect();
@@ -133,8 +133,6 @@ public class FileUploader {
if(info == null) info = I18n.format("replaymod.gui.unknownerror");
ReplayMod.uploadedFileHandler.markAsUploaded(file);
success = true;
} catch(Exception e) {
success = false;
} finally {