@@ -246,6 +246,17 @@ public class Resource
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Installs the {@code getLocalNew} version of this resource to {@code getLocal}.
|
||||||
|
*/
|
||||||
|
public void install () throws IOException {
|
||||||
|
File source = getLocalNew(), dest = getLocal();
|
||||||
|
log.info("- " + source);
|
||||||
|
if (!FileUtil.renameTo(source, dest)) {
|
||||||
|
throw new IOException("Failed to rename " + source + " to " + dest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unpacks this resource file into the directory that contains it. Returns
|
* Unpacks this resource file into the directory that contains it. Returns
|
||||||
* false if an error occurs while unpacking it.
|
* false if an error occurs while unpacking it.
|
||||||
|
|||||||
@@ -144,11 +144,7 @@ public abstract class Getdown extends Thread
|
|||||||
if (_readyToInstall) {
|
if (_readyToInstall) {
|
||||||
log.info("Installing downloaded resources:");
|
log.info("Installing downloaded resources:");
|
||||||
for (Resource resource : _toBeInstalledResouces) {
|
for (Resource resource : _toBeInstalledResouces) {
|
||||||
File source = resource.getLocalNew(), dest = resource.getLocal();
|
resource.install();
|
||||||
log.info("- " + source);
|
|
||||||
if (!FileUtil.renameTo(source, dest)) {
|
|
||||||
throw new IOException("Failed to rename " + source + " to " + dest);
|
|
||||||
}
|
|
||||||
if (Thread.interrupted()) {
|
if (Thread.interrupted()) {
|
||||||
throw new InterruptedException("m.applet_stopped");
|
throw new InterruptedException("m.applet_stopped");
|
||||||
}
|
}
|
||||||
@@ -642,6 +638,7 @@ public abstract class Getdown extends Thread
|
|||||||
reportTrackingEvent("jvm_unpack", -1);
|
reportTrackingEvent("jvm_unpack", -1);
|
||||||
|
|
||||||
updateStatus("m.unpacking_java");
|
updateStatus("m.unpacking_java");
|
||||||
|
vmjar.install();
|
||||||
if (!vmjar.unpack()) {
|
if (!vmjar.unpack()) {
|
||||||
throw new IOException("m.java_unpack_failed");
|
throw new IOException("m.java_unpack_failed");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user