public Set < HttpMethod > allowedMethods ( String uri ) { QueryStringDecoder decoder = new QueryStringDecoder ( uri ) ; String [ ] tokens = PathPattern . removeSlashesAtBothEnds ( decoder . path ( ) ) . split ( "/" ) ; if ( anyMethodRouter . anyMatched ( tokens ) ) { return allAllowedMethods ( ) ; } Set < HttpMethod > ret = new HashSet < HttpMethod > ( routers . size ( ) ) ; for ( Map . Entry < HttpMethod , MethodlessRouter < T > > entry : routers . entrySet ( ) ) { MethodlessRouter < T > router = entry . getValue ( ) ; if ( router . anyMatched ( tokens ) ) { HttpMethod method = entry . getKey ( ) ; ret . add ( method ) ; } } return ret ; }
Returns allowed methods for a specific URI .