Code Search for Developers
 
 
  

MethodFilter.java from Tea Stats at Krugle


Show MethodFilter.java syntax highlighted

/*
 * This file is distributed under the GPL v2 as part of teastats site statistics package
 * http://teastats.sourceforge.net
 */
package net.time4tea.webstats.filter.http;

import net.time4tea.webstats.record.Page;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;

/**
 * Originally richja Apr 2, 2006
 */
public class MethodFilter extends BaseMatcher<Page> {
    private String method;

    public MethodFilter(String method) {
        this.method = method;
    }

    private boolean matches(Page page) {
        return page.getMethod().equals(method);
    }
    
    public boolean matches(Object item) {
        return item instanceof Page && matches((Page) item);
    }

    public void describeTo(Description description) {
        throw new UnsupportedOperationException();
    }

    public static Matcher<Page> methodIs(String method) {
        return new MethodFilter(method);
    }
}




See more files for this project here

Tea Stats

Web log analyzer... Written in OO Perl, provides the usual host / page analysis. Can also do site graphing using graphviz, browser, os, worm and search engine identification, and country and session tracking.

Project homepage: http://sourceforge.net/projects/teastats
Programming language(s): Java
License: other

  MethodFilter.java
  QueryTermFilter.java
  RefererFilter.java
  StatusCodeFilter.java
  SuccessFilter.java