protected void doPost()

in src/main/java/org/apache/sling/launchpad/testservices/servlets/AnonymousAccessConfigServlet.java [69:96]


    protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException,
            IOException {
        response.setContentType(request.getContentType());
        String action = request.getParameter("action");
        if ("disable".equals(action)) {
            int existingModifiedCounter = modifiedCounter;
            Configuration config = configAdmin.getConfiguration(AUTH_PID, null);
            Dictionary props = config.getProperties();
            if (props == null) {
                props = new Hashtable();
            }
            props.put(PROP_AUTH_ANNONYMOUS, Boolean.FALSE);
            config.update(props);
            waitForModified(existingModifiedCounter, TIMEOUT);
        } else if ("enable".equals(action)) {
            int existingModifiedCounter = modifiedCounter;
            Configuration config = configAdmin.getConfiguration(AUTH_PID, null);
            Dictionary props = config.getProperties();
            if (props == null) {
                props = new Hashtable();
            }
            props.put(PROP_AUTH_ANNONYMOUS, Boolean.TRUE);
            config.update(props);
            waitForModified(existingModifiedCounter, TIMEOUT);
        }

        response.getWriter().println("ok");
    }