projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'release-0.9.4'
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
page
/
FreenetTemplatePage.java
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
cd15cbf
..
7338149
100644
(file)
--- 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
–2015
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
@@
-17,6
+17,8
@@
package net.pterodactylus.sone.web.page;
package net.pterodactylus.sone.web.page;
+import static java.util.logging.Logger.getLogger;
+
import java.io.IOException;
import java.io.StringWriter;
import java.net.URI;
import java.io.IOException;
import java.io.StringWriter;
import java.net.URI;
@@
-28,7
+30,6
@@
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.Level;
import java.util.logging.Logger;
-import net.pterodactylus.util.logging.Logging;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.TemplateContextFactory;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.TemplateContextFactory;
@@
-51,7
+52,7
@@
import freenet.support.HTMLNode;
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
/** The logger. */
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
/** The logger. */
- private static final Logger logger =
Logging.getLogger(FreenetTemplatePage.class
);
+ private static final Logger logger =
getLogger(FreenetTemplatePage.class.getName()
);
/** The path of the page. */
private final String path;
/** The path of the page. */
private final String path;
@@
-100,6
+101,7
@@
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
* The request to serve
* @return The title of the page
*/
* The request to serve
* @return The title of the page
*/
+ @SuppressWarnings("static-method")
protected String getPageTitle(FreenetRequest request) {
return null;
}
protected String getPageTitle(FreenetRequest request) {
return null;
}
@@
-155,7
+157,7
@@
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
long start = System.nanoTime();
processTemplate(request, templateContext);
long finish = System.nanoTime();
long start = System.nanoTime();
processTemplate(request, templateContext);
long finish = System.nanoTime();
- logger.log(Level.FINEST,
"Template was rendered in %dms.", ((finish - start) / 1000) / 1000.0
);
+ logger.log(Level.FINEST,
String.format("Template was rendered in %.2fms.", (finish - start) / 1000000.0)
);
} catch (RedirectException re1) {
return new RedirectResponse(re1.getTarget());
}
} catch (RedirectException re1) {
return new RedirectResponse(re1.getTarget());
}
@@
-175,6
+177,7
@@
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
*
* @return Additional style sheets to load
*/
*
* @return Additional style sheets to load
*/
+ @SuppressWarnings("static-method")
protected Collection<String> getStyleSheets() {
return Collections.emptySet();
}
protected Collection<String> getStyleSheets() {
return Collections.emptySet();
}
@@
-184,6
+187,7
@@
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
*
* @return The URL of the shortcut icon, or {@code null} for no icon
*/
*
* @return The URL of the shortcut icon, or {@code null} for no icon
*/
+ @SuppressWarnings("static-method")
protected String getShortcutIcon() {
return null;
}
protected String getShortcutIcon() {
return null;
}
@@
-227,6
+231,7
@@
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
* The request that is processed
* @return The URL to redirect to, or {@code null} to not redirect
*/
* 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;
}
protected String getRedirectTarget(FreenetRequest request) {
return null;
}
@@
-238,6
+243,7
@@
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
* The request for which to return the link nodes
* @return All link nodes that should be added to the HTML head
*/
* 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<Map<String, String>> getAdditionalLinkNodes(FreenetRequest request) {
return Collections.emptyList();
}
protected List<Map<String, String>> getAdditionalLinkNodes(FreenetRequest request) {
return Collections.emptyList();
}
@@
-249,6
+255,7
@@
public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback {
* @return {@code true} if this page should only be allowed for hosts with
* full access, {@code false} to allow this page for any host
*/
* @return {@code true} if this page should only be allowed for hosts with
* full access, {@code false} to allow this page for any host
*/
+ @SuppressWarnings("static-method")
protected boolean isFullAccessOnly() {
return false;
}
protected boolean isFullAccessOnly() {
return false;
}