CmisSync.Lib.Database.Database.LocalFileHasChanged C# (CSharp) Метод

LocalFileHasChanged() публичный Метод

Check whether a file's content has changed locally since it was last synchronized. This happens when the user edits a file on the local computer. This method does not communicate with the CMIS server, it just checks whether the checksum has changed.
public LocalFileHasChanged ( string path ) : bool
path string
Результат bool
        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);
        }