Revision 3906933e trunk/Pithos.Core/FileState.cs
b/trunk/Pithos.Core/FileState.cs | ||
---|---|---|
117 | 117 |
[Property(NotNull = true, Default = "")] |
118 | 118 |
public string ETag { get; set; } |
119 | 119 |
|
120 |
[Property(NotNull = true, Default = "")] |
|
121 |
public string LastMD5 { get; set; } |
|
120 |
//[Property(NotNull = true, Default = "")]
|
|
121 |
//public string LastMD5 { get; set; }
|
|
122 | 122 |
|
123 | 123 |
[Property] |
124 | 124 |
public string Hashes { get; set; } |
... | ... | |
276 | 276 |
Id = Guid.NewGuid(), |
277 | 277 |
OverlayStatus = newStatus, |
278 | 278 |
ETag = Signature.MERKLE_EMPTY, |
279 |
LastMD5=String.Empty, |
|
279 |
//LastMD5=String.Empty,
|
|
280 | 280 |
IsFolder = Directory.Exists(absolutePath) |
281 | 281 |
}; |
282 | 282 |
newState.CreateAndFlush(); |
... | ... | |
377 | 377 |
ExecuteWithRetry((session, instance) => |
378 | 378 |
{ |
379 | 379 |
|
380 |
const string hqlUpdate = "update FileState set Checksum= :checksum,Hashes=:hashes,LastMD5=:md5 where FilePath = :path ";
|
|
380 |
const string hqlUpdate = "update FileState set Checksum= :checksum,Hashes=:hashes where FilePath = :path "; |
|
381 | 381 |
var updatedEntities = session.CreateQuery(hqlUpdate) |
382 | 382 |
.SetString("path", absolutePath) |
383 | 383 |
.SetString("checksum", topHash) |
384 |
.SetString("md5",treeHash.MD5) |
|
384 |
// .SetString("md5",treeHash.MD5)
|
|
385 | 385 |
.SetString("hashes",hashes) |
386 | 386 |
.ExecuteUpdate(); |
387 | 387 |
return updatedEntities; |
... | ... | |
499 | 499 |
|
500 | 500 |
//The file may not exist, if the call is made for a new server object |
501 | 501 |
|
502 |
var md5 = (info is DirectoryInfo || !info.Exists) |
|
503 |
?Signature.MD5_EMPTY |
|
504 |
:((FileInfo)info).ComputeShortHash(notification); |
|
502 |
//var md5 = (info is DirectoryInfo || !info.Exists)
|
|
503 |
// ?Signature.MD5_EMPTY
|
|
504 |
// :((FileInfo)info).ComputeShortHash(notification);
|
|
505 | 505 |
|
506 | 506 |
var length = (info is DirectoryInfo || !info.Exists) |
507 | 507 |
? 0 |
... | ... | |
516 | 516 |
OverlayStatus = FileOverlayStatus.Unversioned, |
517 | 517 |
FileStatus = FileStatus.Created, |
518 | 518 |
ETag=String.Empty, |
519 |
LastMD5=md5, |
|
519 |
//LastMD5=md5,
|
|
520 | 520 |
LastWriteDate=lastWriteTime, |
521 | 521 |
LastLength=length, |
522 | 522 |
IsFolder=(info is DirectoryInfo), |
... | ... | |
589 | 589 |
|
590 | 590 |
public string ToDebugString() |
591 | 591 |
{ |
592 |
return String.Format("[STATE] FilePath:[{0}] ObjectID:[{1}], ETAG: [{2}], Checksum: [{3}] LastMD5:[{4}]", FilePath, ObjectID, |
|
593 |
ETag, Checksum,LastMD5); |
|
592 |
return String.Format("[STATE] FilePath:[{0}] ObjectID:[{1}], ETAG: [{2}], Checksum: [{3}]", FilePath, ObjectID, |
|
593 |
ETag, Checksum); |
|
594 |
//return String.Format("[STATE] FilePath:[{0}] ObjectID:[{1}], ETAG: [{2}], Checksum: [{3}] LastMD5:[{4}]", FilePath, ObjectID, |
|
595 |
// ETag, Checksum, LastMD5); |
|
594 | 596 |
} |
595 | 597 |
} |
596 | 598 |
|
Also available in: Unified diff