projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Split post encoding methods to remove boolean parameters.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
fcp
/
GetSoneCommand.java
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
(file)
--- 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–201
2
David Roden
+ * Sone - GetSoneCommand.java - Copyright © 2011–201
3
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
*
* 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 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 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}.
/**
* 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);
}
super(core);
}
- /**
- * {@inheritDoc}
- */
@Override
public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException {
@Override
public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException {
- Sone sone = get
Sone(parameters, "Sone", false
);
-
Sone localSone = getSone(parameters, "LocalSone", false, false
);
+ Sone sone = get
MandatorySone(parameters, "Sone"
);
+
Optional<Sone> localSone = getOptionalSone(parameters, "LocalSone"
);
return new Response("Sone", encodeSone(sone, "", localSone));
}
return new Response("Sone", encodeSone(sone, "", localSone));
}