protected boolean acceptFile(String filePathStr){
  if (regex != null) {
    Matcher matcher=regex.matcher(filePathStr);
    if (!matcher.matches()) {
      return false;
    }
  }
  return true;
}

protected boolean acceptFile ( String filePathStr ) { if ( regex != null ) { Matcher matcher = regex . matcher ( filePathStr ) ; if ( ! matcher . matches ( ) ) { return false ; } } return true ; }
accepts file which match a regular pattern .
