X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FRescuePage.java;h=8599a3198051c987e2dca4b36676fe859fbccb10;hp=40b03f122a3b9728aa3af55ac0a8824eb44925e6;hb=419098bcd6215125408b29e60bd888e60979d37b;hpb=bb2c8cb2d47a77bcef2d299ad4bf8e16f22a6198 diff --git a/src/main/java/net/pterodactylus/sone/web/RescuePage.java b/src/main/java/net/pterodactylus/sone/web/RescuePage.java index 40b03f1..8599a31 100644 --- a/src/main/java/net/pterodactylus/sone/web/RescuePage.java +++ b/src/main/java/net/pterodactylus/sone/web/RescuePage.java @@ -1,5 +1,5 @@ /* - * Sone - RescuePage.java - Copyright © 2011 David Roden + * Sone - RescuePage.java - Copyright © 2011–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 @@ -17,12 +17,14 @@ package net.pterodactylus.sone.web; +import static net.pterodactylus.sone.utils.NumberParsers.parseLong; + import net.pterodactylus.sone.core.SoneRescuer; import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.sone.web.page.Page.Request.Method; -import net.pterodactylus.util.number.Numbers; +import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; +import net.pterodactylus.util.web.Method; /** * Page that lets the user control the rescue mode for a Sone. @@ -52,13 +54,13 @@ public class RescuePage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException { + protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException { super.processTemplate(request, templateContext); Sone currentSone = getCurrentSone(request.getToadletContext(), false); SoneRescuer soneRescuer = webInterface.getCore().getSoneRescuer(currentSone); if (request.getMethod() == Method.POST) { if ("true".equals(request.getHttpRequest().getPartAsStringFailsafe("fetch", 4))) { - long edition = Numbers.safeParseLong(request.getHttpRequest().getPartAsStringFailsafe("edition", 8), -1L); + long edition = parseLong(request.getHttpRequest().getPartAsStringFailsafe("edition", 8), -1L); if (edition > -1) { soneRescuer.setEdition(edition); }