Package spark
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
Creates a `Redirect` instance -
any
Redirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
get
Redirects any HTTP request of type GET on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
post
Redirects any HTTP request of type POST on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
put
Redirects any HTTP request of type PUT on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
delete
Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath'- Parameters:
fromPath- from pathtoPath- to path
-
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
-