public bool LocalFileHasChanged(string path)
{
// Calculate current checksum.
string currentChecksum = null;
try
{
currentChecksum = Checksum(path);
}
catch (IOException)
{
Logger.Warn("IOException while reading file checksum: " + path
+ " File is probably being edited right now, so skip it. See https://github.com/aegif/CmisSync/issues/245");
return false;
}
// Read previous checksum from database.
string previousChecksum = GetChecksum(path);
// Compare checksums.
if (!currentChecksum.Equals(previousChecksum))
Logger.Info("Checksum of " + path + " has changed from " + previousChecksum + " to " + currentChecksum);
return !currentChecksum.Equals(previousChecksum);
}