public static boolean isLegalFileName(String fileName){
  for (int i=0; i < fileName.length(); i++) {
    char c=fileName.charAt(i);
    if (!isLegalFileNameChar(c)) {
      return false;
    }
  }
  return true;
}

public static boolean isLegalFileName ( String fileName ) { for ( int i = 0 ; i < fileName . length ( ) ; i ++ ) { char c = fileName . charAt ( i ) ; if ( ! isLegalFileNameChar ( c ) ) { return false ; } } return true ; }
checks whether the specified file name is a legal ( dos / windows - ) file name .
