X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpage%2FFreenetTemplatePage.java;h=67884bde34c380e2476c8a4e147388988b9b805e;hb=ba4c1d2a5995657d48dce310ea854fa1f164a481;hp=5c027e5a1ac4fcb5ec81e1a91609410ce0758105;hpb=38cb6c5ec82298ee351d0eb15ddd8331db273af2;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java
index 5c027e5..67884bd 100644
--- a/src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java
+++ b/src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java
@@ -1,5 +1,5 @@
/*
- * Sone - FreenetTemplatePage.java - Copyright © 2010 David Roden
+ * Sone - FreenetTemplatePage.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
@@ -19,6 +19,7 @@ package net.pterodactylus.sone.web.page;
import java.io.IOException;
import java.io.StringWriter;
+import java.net.URI;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -47,7 +48,7 @@ import freenet.support.HTMLNode;
*
* @author David âBombeâ Roden
*/
-public class FreenetTemplatePage implements Page, LinkEnabledCallback {
+public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
/** The logger. */
private static final Logger logger = Logging.getLogger(FreenetTemplatePage.class);
@@ -99,6 +100,7 @@ public class FreenetTemplatePage implements Page, LinkEnabledCal
* The request to serve
* @return The title of the page
*/
+ @SuppressWarnings("static-method")
protected String getPageTitle(FreenetRequest request) {
return null;
}
@@ -154,7 +156,7 @@ public class FreenetTemplatePage implements Page, LinkEnabledCal
long start = System.nanoTime();
processTemplate(request, templateContext);
long finish = System.nanoTime();
- logger.log(Level.FINEST, "Template was rendered in " + ((finish - start) / 1000) / 1000.0 + "ms.");
+ logger.log(Level.FINEST, String.format("Template was rendered in %.2fms.", ((finish - start) / 1000) / 1000.0));
} catch (RedirectException re1) {
return new RedirectResponse(re1.getTarget());
}
@@ -174,6 +176,7 @@ public class FreenetTemplatePage implements Page, LinkEnabledCal
*
* @return Additional style sheets to load
*/
+ @SuppressWarnings("static-method")
protected Collection getStyleSheets() {
return Collections.emptySet();
}
@@ -183,6 +186,7 @@ public class FreenetTemplatePage implements Page, LinkEnabledCal
*
* @return The URL of the shortcut icon, or {@code null} for no icon
*/
+ @SuppressWarnings("static-method")
protected String getShortcutIcon() {
return null;
}
@@ -226,6 +230,7 @@ public class FreenetTemplatePage implements Page, LinkEnabledCal
* The request that is processed
* @return The URL to redirect to, or {@code null} to not redirect
*/
+ @SuppressWarnings("static-method")
protected String getRedirectTarget(FreenetRequest request) {
return null;
}
@@ -237,6 +242,7 @@ public class FreenetTemplatePage implements Page, LinkEnabledCal
* The request for which to return the link nodes
* @return All link nodes that should be added to the HTML head
*/
+ @SuppressWarnings("static-method")
protected List