X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FUnlockSoneCommand.java;h=bc784416640dd0cc24fef29096263a29873bbacb;hp=a18757652f10025896bbb2e84ea1ff940fdd1f24;hb=ffd92ca2374c0b2218e583d02e0bdd24b8c110ae;hpb=f65328fb92d16e568b869bf5f2771dd4114d8abc diff --git a/src/main/java/net/pterodactylus/sone/fcp/UnlockSoneCommand.java b/src/main/java/net/pterodactylus/sone/fcp/UnlockSoneCommand.java index a187576..bc78441 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/UnlockSoneCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/UnlockSoneCommand.java @@ -1,5 +1,5 @@ /* - * Sone - LockSoneCommand.java - Copyright © 2013 David Roden + * Sone - UnlockSoneCommand.java - Copyright © 2013–2016 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 @@ -23,7 +23,8 @@ import net.pterodactylus.sone.freenet.SimpleFieldSetBuilder; 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 @@ -49,10 +50,10 @@ public class UnlockSoneCommand extends AbstractSoneCommand { // @Override - public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { - Sone sone = getSone(parameters, "Sone", true, true); - getCore().unlockSone(sone); - return new Response("SoneUnlocked", new SimpleFieldSetBuilder().put("Sone", sone.getId()).get()); + public Response execute(SimpleFieldSet parameters) 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()); } }