From abcf99251f6e3234ad848b0edcb167c04aba6430 Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Fri, 14 Dec 2007 20:51:50 +0000 Subject: [PATCH] Whoops, getdown is used as a downloading library elsewhere, so Downloader needs to stay a Thread for that usage --- .../threerings/getdown/launcher/Downloader.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/getdown/launcher/Downloader.java b/src/java/com/threerings/getdown/launcher/Downloader.java index cbfc167..2c084a7 100644 --- a/src/java/com/threerings/getdown/launcher/Downloader.java +++ b/src/java/com/threerings/getdown/launcher/Downloader.java @@ -22,7 +22,6 @@ package com.threerings.getdown.launcher; import java.io.File; import java.io.IOException; - import java.util.List; import com.threerings.getdown.Log; @@ -33,7 +32,7 @@ import com.threerings.getdown.data.Resource; * requests to obtain size information and then downloading the files * individually, reporting progress back via a callback interface. */ -public abstract class Downloader +public abstract class Downloader extends Thread { /** * An interface used to communicate status back to an external entity. @@ -85,10 +84,24 @@ public abstract class Downloader */ public Downloader (List resources, Observer obs) { + super("Downloader"); _resources = resources; _obs = obs; } + /** + * This method is invoked as the downloader thread and performs the actual downloading. + */ + @Override + public void run () + { + try { + download(); + } catch (IOException e) { + // This was either logged or reported to our observer in download, so we're good. + } + } + /** * Start downloading the resources in this Downloader. *