import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.freenet.fcp.FcpException;
-import com.google.common.base.Optional;
-
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}.
super(core);
}
- /**
- * {@inheritDoc}
- */
@Override
public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException {
- Sone sone = getSone(parameters, "Sone", false);
- Optional<Sone> localSone = getSone(parameters, "LocalSone", false, false);
+ Sone sone = getMandatorySone(parameters, "Sone");
+ Optional<Sone> localSone = getOptionalSone(parameters, "LocalSone");
return new Response("Sone", encodeSone(sone, "", localSone));
}