Class Redirect
java.lang.Object
spark.Redirect
Provides redirect utility methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe available redirect status codes. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRedirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath'voidany(String fromPath, 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 RedirectCreates a `Redirect` instancevoidRedirects any HTTP request of type DELETE on 'fromPath' to 'toPath'voiddelete(String fromPath, String toPath, Redirect.Status status) Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code.voidRedirects any HTTP request of type GET on 'fromPath' to 'toPath'voidget(String fromPath, String toPath, Redirect.Status status) Redirects any HTTP request of type GET on 'fromPath' to 'toPath' with the provided redirect 'status' code.voidRedirects any HTTP request of type POST on 'fromPath' to 'toPath'voidpost(String fromPath, String toPath, Redirect.Status status) Redirects any HTTP request of type POST on 'fromPath' to 'toPath' with the provided redirect 'status' code.voidRedirects any HTTP request of type PUT on 'fromPath' to 'toPath'voidput(String fromPath, 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(String toPath, Redirect.Status status)
-
Field Details
-
http
-
-
Constructor Details
-
Redirect
-
-
Method Details
-
create
-
any
-
get
-
post
-
put
-
delete
-
any
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
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
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
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
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
-