Пример #1
0
        public bool FileEqualsObject(FileInfo fileInfo, S3ObjectInfo s3Object)
        {
            if (_comparisonFunctions.EqualSize(s3Object, fileInfo))
            {
                if ((_options.OptionCases & OptionCases.SizeOnly) != OptionCases.SizeOnly)
                {
                    return(_comparisonFunctions.EqualETag(s3Object, fileInfo, _options.PartSize));
                }

                return(true);
            }

            return(false);
        }
        public bool EqualSize(S3ObjectInfo s3Object, FileInfo fileInfo)
        {
            if (s3Object is null)
            {
                throw new ArgumentNullException(nameof(s3Object));
            }

            if (fileInfo is null)
            {
                throw new ArgumentNullException(nameof(fileInfo));
            }

            if (_inner.EqualSize(s3Object, fileInfo))
            {
                _log.PutOut($"Size {s3Object.Key} {fileInfo.Name} matched.");
                return(true);
            }

            _log.PutOut($"File {fileInfo.Name} size does not match S3Object {s3Object.Key} size.");
            return(false);
        }