Example #1
0
 static bool SumsAreEqual(IAbsoluteFilePath source, IAbsoluteFilePath destination)
 {
     if (!destination.Exists || !source.Exists)
     {
         return(false);
     }
     return(HashEncryption.MD5FileHash(source) == HashEncryption.MD5FileHash(destination));
 }
Example #2
0
                private async Task OnlyCopyIfHashMisMatch(IAbsoluteFilePath source, IAbsoluteFilePath destination,
                                                          ITProgress status)
                {
                    if (
                        await
                        TaskExt.StartLongRunningTask(
                            () => HashEncryption.MD5FileHash(source) != HashEncryption.MD5FileHash(destination))
                        .ConfigureAwait(false))
                    {
                        await CopyAsyncInternal(source, destination, true, status).ConfigureAwait(false);

                        return;
                    }
                    this.Logger()
                    .Info("Source and destination files equal. Source: {0}, Destination: {1}", source,
                          destination);
                }