@ Override public boolean check ( String [ ] pHostOrAddresses ) { if ( allowedHostsSet == null ) { return true ; } for ( String addr : pHostOrAddresses ) { if ( allowedHostsSet . contains ( addr ) ) { return true ; } if ( allowedSubnetsSet != null && IP_PATTERN . matcher ( addr ) . matches ( ) ) { for ( String subnet : allowedSubnetsSet ) { if ( IpChecker . matches ( subnet , addr ) ) { return true ; } } } } return false ; }
Check for one or more hosts .