From 0ef0283343b64e5b31e4367f7a5687f5a05e4478 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 16 Oct 2010 05:07:39 +0200 Subject: [PATCH] Download new Sones in a background thread. --- src/main/java/net/pterodactylus/sone/web/AddSonePage.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/AddSonePage.java b/src/main/java/net/pterodactylus/sone/web/AddSonePage.java index 647a635..92b9407 100644 --- a/src/main/java/net/pterodactylus/sone/web/AddSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/AddSonePage.java @@ -48,8 +48,17 @@ public class AddSonePage extends SoneTemplatePage { @Override protected void processTemplate(Request request, Template template) throws RedirectException { super.processTemplate(request, template); - String soneKey = request.getHttpRequest().getPartAsStringFailsafe("request-uri", 256); - webInterface.core().loadSone(soneKey); + final String soneKey = request.getHttpRequest().getPartAsStringFailsafe("request-uri", 256); + new Thread(new Runnable() { + + /** + * {@inheritDoc} + */ + @Override + public void run() { + webInterface.core().loadSone(soneKey); + } + }, "Sone Downloader").start(); } } -- 2.7.4