/** * Maps a filter to be executed before any matching routes * * @param filter The filter */ public void before(Filter filter) { addFilter(HttpMethod.before, FilterImpl.create(SparkUtils.ALL_PATHS, filter)); }
/** * Map the route for HTTP PATCH requests * * @param path the path * @param route The route */ public void patch(String path, Route route) { addRoute(HttpMethod.patch, createRouteImpl(path, route)); }
/** * Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code. * * @param fromPath from path * @param toPath to path * @param status status code */ public void delete(String fromPath, String toPath, Status status) { http.delete(fromPath, redirectRoute(toPath, status)); }
/** * Map the route for HTTP CONNECT requests * * @param path the path * @param route The route * @param engine the template engine */ public void connect(String path, TemplateViewRoute route, TemplateEngine engine) { addRoute(HttpMethod.connect, TemplateViewRouteImpl.create(path, route, engine)); }
/** * Redirects any HTTP request of type POST on 'fromPath' to 'toPath' with the provided redirect 'status' code. * * @param fromPath from path * @param toPath to path * @param status status code */ public void post(String fromPath, String toPath, Status status) { http.post(fromPath, redirectRoute(toPath, status)); }
/** * Redirects any HTTP request of type PUT on 'fromPath' to 'toPath' with the provided redirect 'status' code. * * @param fromPath from path * @param toPath to path * @param status status code */ public void put(String fromPath, String toPath, Status status) { http.put(fromPath, redirectRoute(toPath, status)); }
/** * Redirects any HTTP request of type GET on 'fromPath' to 'toPath' with the provided redirect 'status' code. * * @param fromPath from path * @param toPath to path * @param status status code */ public void get(String fromPath, String toPath, Status status) { http.get(fromPath, redirectRoute(toPath, status)); }
/** * Map the route for HTTP PUT requests * * @param path the path * @param route The route * @param transformer the response transformer */ public void put(String path, Route route, ResponseTransformer transformer) { addRoute(HttpMethod.put, ResponseTransformerRouteImpl.create(path, route, transformer)); }
/** * Redirects any HTTP request of type POST on 'fromPath' to 'toPath' with the provided redirect 'status' code. * * @param fromPath from path * @param toPath to path * @param status status code */ public void post(String fromPath, String toPath, Status status) { http.post(fromPath, redirectRoute(toPath, status)); }
/** * Redirects any HTTP request of type PUT on 'fromPath' to 'toPath' with the provided redirect 'status' code. * * @param fromPath from path * @param toPath to path * @param status status code */ public void put(String fromPath, String toPath, Status status) { http.put(fromPath, redirectRoute(toPath, status)); }
/** * Redirects any HTTP request of type GET on 'fromPath' to 'toPath' with the provided redirect 'status' code. * * @param fromPath from path * @param toPath to path * @param status status code */ public void get(String fromPath, String toPath, Status status) { http.get(fromPath, redirectRoute(toPath, status)); }
/** * Map the route for HTTP POST requests * * @param path the path * @param acceptType the accept type * @param route The route */ public void post(String path, String acceptType, Route route) { addRoute(HttpMethod.post, createRouteImpl(path, acceptType, route)); }
/** * Map the route for HTTP CONNECT requests * * @param path the path * @param route The route * @param transformer the response transformer */ public void connect(String path, Route route, ResponseTransformer transformer) { addRoute(HttpMethod.connect, ResponseTransformerRouteImpl.create(path, route, transformer)); }
/** * Maps a filter to be executed after any matching routes * * @param filter The filter */ public void after(Filter filter) { addFilter(HttpMethod.after, FilterImpl.create(SparkUtils.ALL_PATHS, filter)); }
/** * Redirects any HTTP request of type DELETE on 'fromPath' to 'toPath' with the provided redirect 'status' code. * * @param fromPath from path * @param toPath to path * @param status status code */ public void delete(String fromPath, String toPath, Status status) { http.delete(fromPath, redirectRoute(toPath, status)); }
/** * Map the route for HTTP DELETE requests * * @param path the path * @param acceptType the accept type * @param route The route */ public void delete(String path, String acceptType, Route route) { addRoute(HttpMethod.delete, createRouteImpl(path, acceptType, route)); }
/** * Map the route for HTTP POST requests * * @param path the path * @param route The route * @param engine the template engine */ public void post(String path, TemplateViewRoute route, TemplateEngine engine) { addRoute(HttpMethod.post, TemplateViewRouteImpl.create(path, route, engine)); }
/** * Maps a filter to be executed after any matching routes even if the route throws any exception * * @param filter The filter */ public void afterAfter(String path, Filter filter) { addFilter(HttpMethod.afterafter, FilterImpl.create(path, filter)); }
/** * Map the route for HTTP HEAD requests * * @param path the path * @param acceptType the accept type * @param route The route */ public void head(String path, String acceptType, Route route) { addRoute(HttpMethod.head, createRouteImpl(path, acceptType, route)); }
/** * Map the route for HTTP GET requests * * @param path the path * @param route The route * @param transformer the response transformer */ public void get(String path, Route route, ResponseTransformer transformer) { addRoute(HttpMethod.get, ResponseTransformerRouteImpl.create(path, route, transformer)); }