X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FUnlockSoneCommand.java;h=489b6a8292fdf566b84d264385fc6a7d152621be;hb=1b9044499498acfd0f472a5a8ae353665a0fcd10;hp=7ecfada889560711e063206469ad6b93661300ec;hpb=6f019de1d4d9742981d851ac3c9097cca8bff58e;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/fcp/UnlockSoneCommand.java b/src/main/java/net/pterodactylus/sone/fcp/UnlockSoneCommand.java index 7ecfada..489b6a8 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/UnlockSoneCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/UnlockSoneCommand.java @@ -25,8 +25,6 @@ import net.pterodactylus.sone.freenet.fcp.FcpException; import freenet.support.SimpleFieldSet; import freenet.support.api.Bucket; -import com.google.common.base.Optional; - /** * Implements the “UnlockSone” FCP command. If a valid local Sone was given as * parameter “Sone,” this command will always unlock the Sone and reply with @@ -52,9 +50,9 @@ public class UnlockSoneCommand extends AbstractSoneCommand { @Override public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { - Optional sone = getSone(parameters, "Sone", true, true); - getCore().unlockSone(sone.get()); - return new Response("SoneUnlocked", new SimpleFieldSetBuilder().put("Sone", sone.get().getId()).get()); + Sone sone = getMandatoryLocalSone(parameters, "Sone"); + getCore().unlockSone(sone); + return new Response("SoneUnlocked", new SimpleFieldSetBuilder().put("Sone", sone.getId()).get()); } }