Package spark
Class Redirect
java.lang.Object
spark.Redirect
Provides redirect utility methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The available redirect status codes. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Redirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath'void
any
(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 Redirect
Creates a `Redirect` instancevoid
Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath'void
delete
(String fromPath, String toPath, Redirect.Status status) Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code.void
Redirects any HTTP request of type GET on 'fromPath' to 'toPath'void
get
(String fromPath, String toPath, Redirect.Status status) Redirects any HTTP request of type GET on 'fromPath' to 'toPath' with the provided redirect 'status' code.void
Redirects any HTTP request of type POST on 'fromPath' to 'toPath'void
post
(String fromPath, String toPath, Redirect.Status status) Redirects any HTTP request of type POST on 'fromPath' to 'toPath' with the provided redirect 'status' code.void
Redirects any HTTP request of type PUT on 'fromPath' to 'toPath'void
put
(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 Route
redirectRoute
(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
-