class TooManyPathSegmentsDecideRule extends PredicatedDecideRule {

    private static final long serialVersionUID = 3L;
    @SuppressWarnings("unused")
    private static final Logger logger = Logger.getLogger(TooManyPathSegmentsDecideRule.class.getName()); 

    /* default for this class is to REJECT */
    {
        setDecision(DecideResult.REJECT);
    }
    
    {
        setMaxPathDepth(20);
    }
    public int getMaxPathDepth() {
        return (Integer) kp.get("maxPathDepth");
    }
    /**
     * Number of path segments beyond which this rule will reject URIs.
     */
    public void setMaxPathDepth(int maxPathDepth) {
        kp.put("maxPathDepth", maxPathDepth);
    }
    /**
     * Usual constructor. 
     */
    public TooManyPathSegmentsDecideRule() {
    }

    /**
     * Evaluate whether given object is over the threshold number of
     * path-segments.
     * 
     * @param curi
     * @return true if the path-segments is exceeded
     */
    @Override
    protected boolean evaluate(CrawlURI curi) {<FILL_FUNCTION_BODY>}

}

        String uriPath = curi.getUURI().getEscapedPath();
        if (uriPath == null) {
            // no path means no segments
            return false;
        }
        int count = 0;
        int threshold = getMaxPathDepth();
        for (int i = 0; i < uriPath.length(); i++) {
            if (uriPath.charAt(i) == '/') {
                count++;
            }
            if (count > threshold) {
                return true;
            }
        }
        return false;
    
<methods>public void <init>() ,public org.archive.modules.deciderules.DecideResult getDecision() ,public org.archive.modules.deciderules.DecideResult onlyDecision(org.archive.modules.CrawlURI) ,public void setDecision(org.archive.modules.deciderules.DecideResult) <variables>private static final long serialVersionUID