}
/**
- * Checks whether the core knows a Sone with the given ID.
- *
- * @param id
- * The ID of the Sone
- * @return {@code true} if there is a Sone with the given ID, {@code false}
- * otherwise
- */
- public boolean hasSone(String id) {
- synchronized (sones) {
- return sones.containsKey(id);
- }
- }
-
- /**
* Returns all local Sones.
*
* @return All local Sones
@Override
protected JsonObject createJsonObject(FreenetRequest request) {
String soneId = request.getHttpRequest().getParam("sone");
- if (!webInterface.getCore().hasSone(soneId)) {
+ if (!webInterface.getCore().getSone(soneId).isPresent()) {
return createErrorJsonObject("invalid-sone-id");
}
Sone currentSone = getCurrentSone(request.getToadletContext());