Replaced the "Restarts" class with individual restart classes.
[jsvc.git] / src / dolda / jsvc / util / RootRedirect.java
CommitLineData
4126b9f4
FT
1package dolda.jsvc.util;
2
3import dolda.jsvc.*;
4import java.net.*;
5
6public class RootRedirect extends Redirect {
7 private final String to;
8
9 public RootRedirect(String to) {
10 this.to = to;
11 }
12
13 protected URL target(Request req) {
14 try {
15 return(new URL(req.rooturl(), Misc.stripslashes(to, true, false)));
16 } catch(MalformedURLException e) {
17 throw(new RuntimeException("Bad relative URL: + " + to, e));
18 }
19 }
20}