class MatchesFilePatternDecideRule extends MatchesRegexDecideRule {

    public static enum Preset { 
        
        ALL(".*(?i)(\\.(bmp|gif|jpe?g|png|svg|tiff?|aac|aiff?|m3u|m4a|midi?" +
                "|mp2|mp3|mp4|mpa|ogg|ra|ram|wav|wma|asf|asx|avi|flv|mov|mp4" + 
                "|mpeg|mpg|qt|ram|rm|smil|wmv|doc|pdf|ppt|swf))$"),
                    
        IMAGES(".*(?i)(\\.(bmp|gif|jpe?g|png|svg|tiff?))$"),

        AUDIO(".*(?i)(\\.(aac|aiff?|m3u|m4a|midi?|mp2|mp3|mp4|mpa|ogg|ra|ram|wav|wma))$"),
        
        VIDEO(".*(?i)(\\.(asf|asx|avi|flv|mov|mp4|mpeg|mpg|qt|ram|rm|smil|wmv))$"),
            
        MISC(".*(?i)(\\.(doc|pdf|ppt|swf))$"), 

        CUSTOM(null);
        
        final private Pattern pattern;
        
        Preset(String regex) {
            if (regex == null) {
                pattern = null;
            } else {
                pattern = Pattern.compile(regex);
            }
        }
        
        public Pattern getPattern() {
            return pattern;
        }
    }
        
    private static final long serialVersionUID = 3L;

    {
        setUsePreset(Preset.ALL);
    }
    public Preset getUsePreset() {
        return (Preset) kp.get("usePreset");
    }
    public void setUsePreset(Preset preset) {
        kp.put("usePreset",preset); 
    }

    /**
     * Usual constructor.
     */
    public MatchesFilePatternDecideRule() {
    }

    /**
     * Use a preset if configured to do so.
     * @return regex to use.
     */
    @Override
    public Pattern getRegex() {<FILL_FUNCTION_BODY>}
}

        Preset preset = getUsePreset();
        if (preset == Preset.CUSTOM) {
            return super.getRegex();
        }
        return preset.getPattern();
    
<methods>public void <init>() ,public java.util.regex.Pattern getRegex() ,public void setRegex(java.util.regex.Pattern) <variables>private static final long serialVersionUID