Package org.jstripe.tomcat.probe.controllers.logs

Source Code of org.jstripe.tomcat.probe.controllers.logs.ClearBufferController

/*
* Licensed under the GPL License. You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*   http://probe.jstripe.com/d/license.shtml
*
*  THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
*  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
*  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/

package org.jstripe.tomcat.probe.controllers.logs;

import org.springframework.web.servlet.mvc.AbstractController;
import org.springframework.web.servlet.ModelAndView;
import org.jstripe.tomcat.probe.model.FollowedFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class ClearBufferController extends AbstractController {
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpSession session = request.getSession();
        if (session != null) {
            FollowedFile ff = (FollowedFile) session.getAttribute("followed_file");
            if (ff != null) ff.getLines().clear();
        }
        return null;
    }
}
TOP

Related Classes of org.jstripe.tomcat.probe.controllers.logs.ClearBufferController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.