From: David ‘Bombe’ Roden Date: Sat, 16 Oct 2010 03:07:39 +0000 (+0200) Subject: Download new Sones in a background thread. X-Git-Tag: 0.1-RC1~283 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0ef0283343b64e5b31e4367f7a5687f5a05e4478;p=Sone.git Download new Sones in a background thread. --- 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(); } }