X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FJsonPage.java;h=22eeec8ec855eda36cca525a5aef137efbd25594;hp=4ee3b99e3d26beb9f50ca7988c0c56013d0fccc1;hb=8fb7349579c0c82d7143601c2007cad6f4cfb000;hpb=49f646dc72f59ebd385915ba8362902459557b7f diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java index 4ee3b99..22eeec8 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/JsonPage.java @@ -1,5 +1,5 @@ /* - * 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 @@ -28,8 +28,8 @@ import net.pterodactylus.util.json.JsonObject; 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 @@ -139,6 +139,7 @@ public abstract class JsonPage implements FreenetPage { * @return {@code true} if the form password (given as “formPassword”) is * required, {@code false} otherwise */ + @SuppressWarnings("static-method") protected boolean needsFormPassword() { return true; } @@ -149,6 +150,7 @@ public abstract class JsonPage implements FreenetPage { * @return {@code true} if the user needs to be logged in to use this page, * {@code false} otherwise */ + @SuppressWarnings("static-method") protected boolean requiresLogin() { return true; } @@ -162,7 +164,7 @@ public abstract class JsonPage implements FreenetPage { * * @return A reply signaling success */ - protected JsonObject createSuccessJsonObject() { + protected static JsonObject createSuccessJsonObject() { return new JsonObject().put("success", true); } @@ -173,7 +175,7 @@ public abstract class JsonPage implements FreenetPage { * 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); }