X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FGetSoneCommand.java;h=2e2cbc9167e8220ca863f9923960fa31eb4e9cb1;hb=7fb49938b9198110c34bcc600c545bfa91acf6f2;hp=c71ea43601dcca8ec62cf6932370dec96169a437;hpb=480691a26222e035e53bda56029524e160fdf898;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/fcp/GetSoneCommand.java b/src/main/java/net/pterodactylus/sone/fcp/GetSoneCommand.java index c71ea43..2e2cbc9 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/GetSoneCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/GetSoneCommand.java @@ -1,5 +1,5 @@ /* - * Sone - GetSoneCommand.java - Copyright © 2011–2012 David Roden + * Sone - GetSoneCommand.java - Copyright © 2011–2013 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,9 +21,12 @@ import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.freenet.fcp.FcpException; + import freenet.support.SimpleFieldSet; import freenet.support.api.Bucket; +import com.google.common.base.Optional; + /** * Implements the “GetSone“ FCP command which returns {@link Profile} * information about a {@link Sone}. @@ -42,13 +45,10 @@ public class GetSoneCommand extends AbstractSoneCommand { super(core); } - /** - * {@inheritDoc} - */ @Override public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { - Sone sone = getSone(parameters, "Sone", false); - Sone localSone = getSone(parameters, "LocalSone", false, false); + Sone sone = getMandatorySone(parameters, "Sone"); + Optional localSone = getOptionalSone(parameters, "LocalSone"); return new Response("Sone", encodeSone(sone, "", localSone)); }