public boolean accept ( File pathname ) { String name = pathname . getName ( ) ; int iLastDot = name . lastIndexOf ( ' ' ) ; String strExtension = "" ; if ( ( iLastDot != - 1 ) && ( iLastDot != name . length ( ) - 1 ) ) strExtension = name . substring ( iLastDot + 1 ) ; if ( m_rgstrIncludeExtensions != null ) { for ( int i = 0 ; i < m_rgstrIncludeExtensions . length ; i ++ ) { if ( m_rgstrIncludeExtensions [ i ] . equalsIgnoreCase ( strExtension ) ) return true ; // Accept } return false ; // Not in included - return } if ( m_rgstrExcludeExtensions != null ) { for ( int i = 0 ; i < m_rgstrExcludeExtensions . length ; i ++ ) { if ( m_rgstrExcludeExtensions [ i ] . equalsIgnoreCase ( strExtension ) ) return false ; // Don't accept } } return true ; // Accept this file }
Tests whether or not the specified abstract pathname should be included in a pathname list .