private void initQueryMap() { if (queryMap == null) { queryMap = new QueryParamsMap(raw()); } }
/** * Map the route for HTTP GET requests * * @param path the path * @param acceptType the accept type * @param route The route * @param transformer the response transformer */ public static void get(String path, String acceptType, Route route, ResponseTransformer transformer) { getInstance().get(path, acceptType, route, transformer); }
/** * Maps one or many filters to be executed before any matching routes * * @param filters The filters */ public static void before(Filter... filters) { for (Filter filter : filters) { getInstance().before(filter); } }
/** * Map the route for HTTP PUT requests * * @param path the path * @param route The route * @param engine the template engine */ public static void put(String path, TemplateViewRoute route, TemplateEngine engine) { getInstance().put(path, route, engine); }
/** * Immediately stops a request within a filter or route * NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise * halt will not work */ public static HaltException halt() { throw getInstance().halt(); }
/** * Map the route for HTTP PATCH requests * * @param path the path * @param acceptType the accept type * @param route The route */ public static void patch(String path, String acceptType, Route route) { getInstance().patch(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)); }
/** * Configures the embedded web server's thread pool. * * @param maxThreads max nbr of threads. * @param minThreads min nbr of threads. * @param idleTimeoutMillis thread idle timeout (ms). */ public static void threadPool(int maxThreads, int minThreads, int idleTimeoutMillis) { getInstance().threadPool(maxThreads, minThreads, idleTimeoutMillis); }
/** * Maps 500 internal server errors to the provided custom page */ public static void internalServerError(String page) { getInstance().internalServerError(page); }
/** * 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 TRACE requests * * @param path the path * @param route The route */ public static void trace(String path, Route route) { getInstance().trace(path, route); }
/** * Map the route for HTTP PATCH requests * * @param path the path * @param route The route * @param transformer the response transformer */ public static void patch(String path, Route route, ResponseTransformer transformer) { getInstance().patch(path, route, transformer); }
/** * Map the route for HTTP POST requests * * @param path the path * @param route The route * @param transformer the response transformer */ public void post(String path, Route route, ResponseTransformer transformer) { addRoute(HttpMethod.post, ResponseTransformerRouteImpl.create(path, route, transformer)); }
/** * Map the route for HTTP POST requests * * @param path the path * @param acceptType the accept type * @param route The route * @param transformer the response transformer */ public void post(String path, String acceptType, Route route, ResponseTransformer transformer) { addRoute(HttpMethod.post, ResponseTransformerRouteImpl.create(path, acceptType, route, transformer)); }
/** * Map the route for HTTP DELETE requests * * @param path the path * @param route The route * @param transformer the response transformer */ public void delete(String path, Route route, ResponseTransformer transformer) { addRoute(HttpMethod.delete, ResponseTransformerRouteImpl.create(path, route, transformer)); }
/** * Map the route for HTTP PATCH requests * * @param path the path * @param route The route * @param transformer the response transformer */ public void patch(String path, Route route, ResponseTransformer transformer) { addRoute(HttpMethod.patch, ResponseTransformerRouteImpl.create(path, route, transformer)); }