Package spark
Class Redirect
- java.lang.Object
-
- spark.Redirect
-
public final class Redirect extends java.lang.ObjectProvides redirect utility methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRedirect.StatusThe available redirect status codes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidany(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath'voidany(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code.(package private) static Redirectcreate(Routable http)Creates a `Redirect` instancevoiddelete(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath'voiddelete(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code.voidget(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type GET on 'fromPath' to 'toPath'voidget(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type GET on 'fromPath' to 'toPath' with the provided redirect 'status' code.voidpost(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type POST on 'fromPath' to 'toPath'voidpost(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type POST on 'fromPath' to 'toPath' with the provided redirect 'status' code.voidput(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type PUT on 'fromPath' to 'toPath'voidput(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type PUT on 'fromPath' to 'toPath' with the provided redirect 'status' code.private static RouteredirectRoute(java.lang.String toPath, Redirect.Status status)
-
-
-
Field Detail
-
http
private Routable http
-
-
Constructor Detail
-
Redirect
private Redirect(Routable http)
-
-
Method Detail
-
any
public void any(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
get
public void get(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type GET on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
post
public void post(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type POST on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
put
public void put(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type PUT on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
delete
public void delete(java.lang.String fromPath, java.lang.String toPath)Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
any
public void any(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code.- Parameters:
fromPath- from pathtoPath- to pathstatus- status code
-
get
public void get(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type GET on 'fromPath' to 'toPath' with the provided redirect 'status' code.- Parameters:
fromPath- from pathtoPath- to pathstatus- status code
-
post
public void post(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type POST on 'fromPath' to 'toPath' with the provided redirect 'status' code.- Parameters:
fromPath- from pathtoPath- to pathstatus- status code
-
put
public void put(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type PUT on 'fromPath' to 'toPath' with the provided redirect 'status' code.- Parameters:
fromPath- from pathtoPath- to pathstatus- status code
-
delete
public void delete(java.lang.String fromPath, java.lang.String toPath, Redirect.Status status)Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code.- Parameters:
fromPath- from pathtoPath- to pathstatus- status code
-
redirectRoute
private static Route redirectRoute(java.lang.String toPath, Redirect.Status status)
-
-