Package spark

Class Redirect

java.lang.Object
spark.Redirect

public final class Redirect extends Object
Provides redirect utility methods.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The available redirect status codes.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    any(String fromPath, String toPath)
    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.
    void
    delete(String fromPath, String toPath)
    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
    get(String fromPath, String toPath)
    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
    post(String fromPath, String toPath)
    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
    put(String fromPath, String toPath)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • any

      public void any(String fromPath, String toPath)
      Redirects any HTTP request of type GET, POST, PUT, DELETE on 'fromPath' to 'toPath'
      Parameters:
      fromPath - from path
      toPath - to path
    • get

      public void get(String fromPath, String toPath)
      Redirects any HTTP request of type GET on 'fromPath' to 'toPath'
      Parameters:
      fromPath - from path
      toPath - to path
    • post

      public void post(String fromPath, String toPath)
      Redirects any HTTP request of type POST on 'fromPath' to 'toPath'
      Parameters:
      fromPath - from path
      toPath - to path
    • put

      public void put(String fromPath, String toPath)
      Redirects any HTTP request of type PUT on 'fromPath' to 'toPath'
      Parameters:
      fromPath - from path
      toPath - to path
    • delete

      public void delete(String fromPath, String toPath)
      Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath'
      Parameters:
      fromPath - from path
      toPath - to path
    • any

      public 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.
      Parameters:
      fromPath - from path
      toPath - to path
      status - status code
    • get

      public 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.
      Parameters:
      fromPath - from path
      toPath - to path
      status - status code
    • post

      public 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.
      Parameters:
      fromPath - from path
      toPath - to path
      status - status code
    • put

      public 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.
      Parameters:
      fromPath - from path
      toPath - to path
      status - status code
    • delete

      public 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.
      Parameters:
      fromPath - from path
      toPath - to path
      status - status code