X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpage%2FFreenetTemplatePage.kt;h=3912f987ae26605ecf5f59d41462d209fe35e593;hp=d5d8f06a95ce205b4ec3935c6a3ae9391d18ff75;hb=HEAD;hpb=5201720801a4053f8f324b71fb3e9c36f6cd911e diff --git a/src/main/kotlin/net/pterodactylus/sone/web/page/FreenetTemplatePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/page/FreenetTemplatePage.kt index d5d8f06..3912f98 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/page/FreenetTemplatePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/page/FreenetTemplatePage.kt @@ -1,5 +1,5 @@ /* - * Sone - FreenetTemplatePage.java - Copyright © 2010–2019 David Roden + * Sone - FreenetTemplatePage.kt - Copyright © 2010–2020 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 @@ -98,6 +98,9 @@ open class FreenetTemplatePage( /* do nothing. */ } + fun redirectTo(target: String?): Nothing = + throw RedirectException(target) + class RedirectException(val target: String?) : Exception() { override fun toString(): String = format("RedirectException{target='%s'}", target) }