rapiddata
This commit is contained in:
@@ -254,7 +254,7 @@ public class TaskWindow extends javax.swing.JDialog
|
||||
public void onFailed(Task task) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
if(taskList == null) return;
|
||||
failReasons.add(task.getInfo() + ": " + (null == task.getFailReason() ? "No exception" : task.getFailReason().getLocalizedMessage()));
|
||||
failReasons.add(task.getInfo() + ": " + (null == task.getFailReason() ? "No exception" : (StrUtils.isBlank(task.getFailReason().getLocalizedMessage()) ? task.getFailReason().getClass().getSimpleName() : task.getFailReason().getLocalizedMessage())));
|
||||
pgsTotal.setMaximum(taskList.taskCount());
|
||||
pgsTotal.setValue(pgsTotal.getValue() + 1);
|
||||
int idx = tasks.indexOf(task);
|
||||
|
||||
@@ -51,15 +51,14 @@ public final class NetUtils {
|
||||
|
||||
public static String getStreamContent(InputStream is, String encoding)
|
||||
throws IOException {
|
||||
String result;
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(is, encoding))) {
|
||||
result = "";
|
||||
String line;
|
||||
while ((line = br.readLine()) != null)
|
||||
result += line + "\n";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
try (InputStreamReader br = new InputStreamReader(is, encoding)) {
|
||||
int len;
|
||||
char[] buf = new char[16384];
|
||||
while ((len = br.read(buf)) != -1)
|
||||
sb.append(buf, 0, len);
|
||||
}
|
||||
if (result.length() < 1) return "";
|
||||
else return result.substring(0, result.length() - 1);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String doGet(String url, String encoding) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user