package gw.servlet uses gw.lang.annotation.AnnotationUsage uses org.apache.commons.io.FilenameUtils uses gw.lang.reflect.IFeatureInfo uses gw.lang.reflect.gs.IGosuClass @AnnotationUsage(TypeTarget, One) class Servlet implements IServletAnnotation { private var _pathMatcher : block( path : String ) : boolean private var _servletPath : String as ServletPath construct(final pathPattern : String) { _pathMatcher = \ path -> { return FilenameUtils.wildcardMatch( path, pathPattern) } } construct(pathMatcher : block( path : String ) : boolean) { _pathMatcher = pathMatcher } construct(inServletPath : String, final pathPattern : String) { _servletPath = inServletPath _pathMatcher = \ path -> { return FilenameUtils.wildcardMatch( path, pathPattern) } } construct(inServletPath : String, pathMatcher : block( path : String ) : boolean) { _servletPath = inServletPath _pathMatcher = pathMatcher } override function matchesPath(path : String) : boolean { return _pathMatcher(path == null ? "" : path) } }