Now installer will set the url of base jar of Forge and LiteLoader.

This commit is contained in:
huanghongxun
2015-07-28 22:56:31 +08:00
parent c3008ec294
commit e4335cf1f0
10 changed files with 520 additions and 601 deletions

View File

@@ -262,7 +262,7 @@ public class TaskWindow extends javax.swing.JDialog
@Override
public void onFailed(Task task) {
SwingUtilities.invokeLater(() -> {
failReasons.add(task.getInfo() + ": " + (null == task.getFailReason() ? "No exception" : task.getFailReason().getLocalizedMessage()));
failReasons.add(task.getInfo() + ": " + (null == task.getFailReason() ? "No exception" : task.getFailReason().getClass().toString() + ": " + task.getFailReason().getLocalizedMessage()));
pgsTotal.setMaximum(taskList.taskCount());
pgsTotal.setValue(pgsTotal.getValue() + 1);
int idx = tasks.indexOf(task);

View File

@@ -431,15 +431,4 @@ public class FileUtils {
if (f.getName().endsWith(suffix)) al.add(f);
return al.toArray(new File[0]);
}
public static byte[] toByteArray(File file) throws IOException {
try (FileInputStream is = new FileInputStream(file)) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
int n;
byte[] b = new byte[1024];
while ((n = is.read(b)) != -1) os.write(b, 0, n);
os.close();
return os.toByteArray();
}
}
}

View File

@@ -195,10 +195,12 @@ class BlockInputStream extends InputStream {
filterChain = filters[i].getInputStream(filterChain);
}
@Override
public int read() throws IOException {
return read(tempBuf, 0, 1) == -1 ? -1 : (tempBuf[0] & 0xFF);
}
@Override
public int read(byte[] buf, int off, int len) throws IOException {
if (endReached)
return -1;