public static String verifyFiles(File... files){
  StringBuilder sb=new StringBuilder();
  for (  File f : files) {
    if (f == null || !f.exists()) {
      sb.append("File " + f + " does not exist.\n");
    }
    if (f == null || !f.canRead()) {
      sb.append("File " + f + " can not be read.\n");
    }
  }
  if (sb.length() == 0)   return null;
 else   return sb.toString();
}

public static String verifyFiles ( File ... files ) { StringBuilder sb = new StringBuilder ( ) ; for ( File f : files ) { if ( f == null || ! f . exists ( ) ) { sb . append ( "File " + f + " does not exist.\n" ) ; } if ( f == null || ! f . canRead ( ) ) { sb . append ( "File " + f + " can not be read.\n" ) ; } } if ( sb . length ( ) == 0 ) return null ; else return sb . toString ( ) ; }
checks if a file can be exists , and if it can be read .
