public boolean accept ( String path ) { if ( allow . isEmpty ( ) && deny . isEmpty ( ) ) { return true ; } // Check if the path is denied for ( Pattern p : deny ) { if ( p . matcher ( path ) . matches ( ) ) { return false ; } } // Check if the path is accepted for ( Pattern p : allow ) { if ( p . matcher ( path ) . matches ( ) ) { return true ; } } // Denied by default. return ! deny . isEmpty ( ) ; }
Checks whether the given path is accepted or rejected by the current server .