@@ -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
|
||||
* false if an error occurs while unpacking it.
|
||||
|
||||
@@ -144,11 +144,7 @@ public abstract class Getdown extends Thread
|
||||
if (_readyToInstall) {
|
||||
log.info("Installing downloaded resources:");
|
||||
for (Resource resource : _toBeInstalledResouces) {
|
||||
File source = resource.getLocalNew(), dest = resource.getLocal();
|
||||
log.info("- " + source);
|
||||
if (!FileUtil.renameTo(source, dest)) {
|
||||
throw new IOException("Failed to rename " + source + " to " + dest);
|
||||
}
|
||||
resource.install();
|
||||
if (Thread.interrupted()) {
|
||||
throw new InterruptedException("m.applet_stopped");
|
||||
}
|
||||
@@ -642,6 +638,7 @@ public abstract class Getdown extends Thread
|
||||
reportTrackingEvent("jvm_unpack", -1);
|
||||
|
||||
updateStatus("m.unpacking_java");
|
||||
vmjar.install();
|
||||
if (!vmjar.unpack()) {
|
||||
throw new IOException("m.java_unpack_failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user