public List < T > list ( String str ) { Map < String , T > map = new LinkedHashMap < String , T > ( ) ; if ( str == null || str . length ( ) == 0 ) // Select all resources by default str = "%" ; String [ ] tokens = str . split ( "," ) ; for ( String token : tokens ) { token = token . trim ( ) ; if ( token . length ( ) > 0 ) { Pattern pattern = Pattern . compile ( token . replace ( "?" , ".?" ) . replace ( "%" , ".*?" ) ) ; for ( NamedResource resource : names . values ( ) ) { if ( pattern . matcher ( resource . getName ( ) ) . matches ( ) ) map . put ( resource . getName ( ) , ( T ) resource ) ; } } } List < T > ret = new ArrayList < T > ( ) ; ret . addAll ( map . values ( ) ) ; return ret ; }
Returns the resources that match the given comma - separated list of names .