From 5c5ef0964da82ea0f677ea0e7f24901f8e31af88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 17 Nov 2010 13:45:08 +0100 Subject: [PATCH] Convert the URI a Sone was downloaded from to USK before setting it. --- src/main/java/net/pterodactylus/sone/core/SoneDownloader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java index 42f6702..2310aca 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java @@ -155,7 +155,11 @@ public class SoneDownloader extends AbstractService { soneInputStream = soneBucket.getInputStream(); Sone parsedSone = parseSone(originalSone, soneInputStream); if (parsedSone != null) { - parsedSone.setRequestUri(requestUri.setMetaString(new String[0])); + if (requestUri.getKeyType().equals("USK")) { + parsedSone.setRequestUri(requestUri.setMetaString(new String[0])); + } else { + parsedSone.setRequestUri(requestUri.setKeyType("USK").setDocName("Sone").setMetaString(new String[0])); + } } return parsedSone; } catch (IOException ioe1) { -- 2.7.4