Class DosGuardFilter

  • All Implemented Interfaces:
    javax.servlet.Filter

    public class DosGuardFilter
    extends Object
    implements javax.servlet.Filter
    A rewrite of the multipart filter from the com.oreilly.servlet package. The rewrite allows us to use initialization parameters specified in the Lutece configuration files.
    • Constructor Detail

      • DosGuardFilter

        public DosGuardFilter()
    • Method Detail

      • init

        public void init​(javax.servlet.FilterConfig config)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Filter
      • doFilter

        public void doFilter​(javax.servlet.ServletRequest request,
                             javax.servlet.ServletResponse response,
                             javax.servlet.FilterChain chain)
                      throws IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Throws:
        IOException
        javax.servlet.ServletException
      • isAllowed

        public boolean isAllowed​(String strRemoteAddr,
                                 int iContentLength)
        Checks if a client is allowed to make a request at the present time.
        Parameters:
        strRemoteAddr - the IP address of the client
        iContentLength - the size of the request
        Returns:
        true if allowed, false otherwize