public bool Equals(GoogleDriveFile other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Id.Equals(other.Id, StringComparison.InvariantCultureIgnoreCase) &&
                   Name.Equals(other.Name, StringComparison.InvariantCultureIgnoreCase) &&
                   FullName.Equals(other.FullName, StringComparison.InvariantCultureIgnoreCase) &&
                   Md5Checksum.Equals(other.Md5Checksum, StringComparison.InvariantCultureIgnoreCase) &&
                   SizeInBytes == other.SizeInBytes);
        }
示例#2
0
 public override bool Execute()
 {
     using (var writer = new StreamWriter(LogFile, !Overwrite))
     {
         if (WriteHeaders)
         {
             writer.WriteLine("File,MD5,Version,Modified");
         }
         var lengthToDrop = string.IsNullOrEmpty(PathPrefixToDrop) ? 0 : PathPrefixToDrop.Length;
         foreach (var file in Files)
         {
             var md5 = Md5Checksum.Compute(file);
             // Some files have commas in their versions. Replace with another character because our CSV reader is cheap.
             var version  = FileVersionInfo.GetVersionInfo(file).FileVersion?.Replace(',', ';');
             var modified = File.GetLastWriteTimeUtc(file);
             writer.WriteLine($"{file.Substring(lengthToDrop)},{md5},{version},{modified:yyyy-MM-dd HH:mm:ss}");
         }
         return(true);
     }
 }