/*
- * Sone - JsonPage.java - Copyright © 2010 David Roden
+ * Sone - JsonPage.java - Copyright © 2010–2012 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
import net.pterodactylus.util.json.JsonUtils;
import net.pterodactylus.util.web.Page;
import net.pterodactylus.util.web.Response;
-import freenet.clients.http.ToadletContext;
import freenet.clients.http.SessionManager.Session;
+import freenet.clients.http.ToadletContext;
/**
* A JSON page is a specialized {@link Page} that will always return a JSON
*
* @return A reply signaling success
*/
- protected JsonObject createSuccessJsonObject() {
+ protected static JsonObject createSuccessJsonObject() {
return new JsonObject().put("success", true);
}
* The error that has occured
* @return The JSON object, signalling failure and the error code
*/
- protected JsonObject createErrorJsonObject(String error) {
+ protected static JsonObject createErrorJsonObject(String error) {
return new JsonObject().put("success", false).put("error", error);
}