| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ConfigurationInitializationServlet |
|
| 1.0;1 |
| 1 | package org.restafarian.core.servlets; | |
| 2 | ||
| 3 | import java.io.IOException; | |
| 4 | ||
| 5 | import javax.servlet.ServletConfig; | |
| 6 | import javax.servlet.ServletException; | |
| 7 | import javax.servlet.http.HttpServletRequest; | |
| 8 | import javax.servlet.http.HttpServletResponse; | |
| 9 | ||
| 10 | import org.apache.commons.configuration.Configuration; | |
| 11 | import org.restafarian.core.security.AuthenticatedUserManager; | |
| 12 | ||
| 13 | 0 | public class ConfigurationInitializationServlet extends RestServletBase { |
| 14 | private static final long serialVersionUID = 1; | |
| 15 | ||
| 16 | /** | |
| 17 | * <p>Servlet init method.</p> | |
| 18 | * | |
| 19 | * @param config the ServletConfig object | |
| 20 | */ | |
| 21 | public void init(ServletConfig config) { | |
| 22 | 0 | super.init(config); |
| 23 | 0 | Configuration configuration = (Configuration) context.getAttribute("configuration"); |
| 24 | 0 | AuthenticatedUserManager.init(context, configuration); |
| 25 | 0 | } |
| 26 | ||
| 27 | /** | |
| 28 | * <p>The Servlet "doGet()" method.</p> | |
| 29 | * | |
| 30 | * @param req the <code>HttpServletRequest</code> object | |
| 31 | * @param res the <code>HttpServletResponse</code> object | |
| 32 | * @throws ServletException | |
| 33 | * @throws IOException | |
| 34 | */ | |
| 35 | public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { | |
| 36 | 0 | sendError(req, res, 405, "Method Not Allowed."); |
| 37 | 0 | } |
| 38 | ||
| 39 | /** | |
| 40 | * <p>The Servlet "doPost()" method.</p> | |
| 41 | * | |
| 42 | * @param req the <code>HttpServletRequest</code> object | |
| 43 | * @param res the <code>HttpServletResponse</code> object | |
| 44 | * @throws ServletException | |
| 45 | * @throws IOException | |
| 46 | */ | |
| 47 | public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { | |
| 48 | 0 | sendError(req, res, 405, "Method Not Allowed."); |
| 49 | 0 | } |
| 50 | ||
| 51 | /** | |
| 52 | * <p>The Servlet "doPut()" method.</p> | |
| 53 | * | |
| 54 | * @param req the <code>HttpServletRequest</code> object | |
| 55 | * @param res the <code>HttpServletResponse</code> object | |
| 56 | * @throws ServletException | |
| 57 | * @throws IOException | |
| 58 | */ | |
| 59 | public void doPut(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { | |
| 60 | 0 | sendError(req, res, 405, "Method Not Allowed."); |
| 61 | 0 | } |
| 62 | ||
| 63 | /** | |
| 64 | * <p>The Servlet "doDelete()" method.</p> | |
| 65 | * | |
| 66 | * @param req the <code>HttpServletRequest</code> object | |
| 67 | * @param res the <code>HttpServletResponse</code> object | |
| 68 | * @throws ServletException | |
| 69 | * @throws IOException | |
| 70 | */ | |
| 71 | public void doDelete(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { | |
| 72 | 0 | sendError(req, res, 405, "Method Not Allowed."); |
| 73 | 0 | } |
| 74 | } |