private static boolean addFileDigest(File file,MessageDigest digest,@Nullable IgniteLogger log){
  if (!file.isFile()) {
    U.error(log,"Failed to add file to directory digest (will not check MD5 hash): " + file);
    return false;
  }
  InputStream in=null;
  try {
    in=new BufferedInputStream(new FileInputStream(file));
    byte[] buf=new byte[1024];
    int read=in.read(buf,0,1024);
    while (read > -1) {
      digest.update(buf,0,read);
      read=in.read(buf,0,1024);
    }
  }
 catch (  IOException e) {
    U.error(log,"Failed to add file to directory digest (will not check MD5 hash): " + file,e);
    return false;
  }
 finally {
    U.closeQuiet(in);
  }
  return true;
}

private static boolean addFileDigest ( File file , MessageDigest digest , @ Nullable IgniteLogger log ) { if ( ! file . isFile ( ) ) { U . error ( log , "Failed to add file to directory digest (will not check MD5 hash): " + file ) ; return false ; } InputStream in = null ; try { in = new BufferedInputStream ( new FileInputStream ( file ) ) ; byte [ ] buf = new byte [ 1024 ] ; int read = in . read ( buf , 0 , 1024 ) ; while ( read > - 1 ) { digest . update ( buf , 0 , read ) ; read = in . read ( buf , 0 , 1024 ) ; } } catch ( IOException e ) { U . error ( log , "Failed to add file to directory digest (will not check MD5 hash): " + file , e ) ; return false ; } finally { U . closeQuiet ( in ) ; } return true ; }
adds given file to the given digest object .
