Modified Differencer to set the PreviousHash value for Common objects
[pithos-ms-client] / trunk / Pithos.Interfaces / ObjectInfo.cs
index d9f49a7..0eaa047 100644 (file)
@@ -164,6 +164,8 @@ namespace Pithos.Interfaces
         [JsonProperty("X_Object_Public")]
         public string PublicUrl { get; set; }
 
+        public string PreviousHash { get; set; }
+
         public ObjectInfo()
         {}
 
@@ -310,5 +312,14 @@ namespace Pithos.Interfaces
             }
             Permissions = permDict;
         }
+
+        //The previous values that correspond to a NoModification object
+        //have the same account, container and possibly the same folder
+        public bool CorrespondsTo(ObjectInfo other)
+        {
+            return other.Account == this.Account
+                   && other.Container == this.Container
+                   && (this.Name == null || other.Name.StartsWith(this.Name));
+        }
     }
 }
\ No newline at end of file