Revision cfed7823 trunk/Pithos.Core/Agents/WorkflowAgent.cs
b/trunk/Pithos.Core/Agents/WorkflowAgent.cs | ||
---|---|---|
47 | 47 |
{ |
48 | 48 |
if (state.Skip) |
49 | 49 |
return CompletedTask<object>.Default; |
50 |
string path = state.Path.ToLower(); |
|
51 |
string fileName = Path.GetFileName(path); |
|
50 |
string path = state.Path.ToLower(); |
|
52 | 51 |
|
53 | 52 |
//Bypass deleted files, unless the status is Deleted |
54 | 53 |
if (!File.Exists(path) && state.Status != FileStatus.Deleted) |
55 | 54 |
{ |
56 | 55 |
state.Skip = true; |
57 |
this.StatusKeeper.RemoveFileOverlayStatus(path);
|
|
56 |
this.StatusKeeper.ClearFileStatus(path);
|
|
58 | 57 |
return CompletedTask<object>.Default; |
59 | 58 |
} |
60 | 59 |
var fileState = FileState.FindByFilePath(path); |
61 | 60 |
var blockHash = NetworkAgent.BlockHash; |
62 | 61 |
var blockSize = NetworkAgent.BlockSize; |
62 |
var info = new FileInfo(path); |
|
63 | 63 |
|
64 | 64 |
switch (state.Status) |
65 | 65 |
{ |
66 | 66 |
case FileStatus.Created: |
67 | 67 |
case FileStatus.Modified: |
68 |
var info = new FileInfo(path); |
|
69 | 68 |
NetworkAgent.Post(new CloudAction(CloudActionType.UploadUnconditional, info, ObjectInfo.Empty, fileState,blockSize,blockHash)); |
70 | 69 |
break; |
71 | 70 |
case FileStatus.Deleted: |
71 |
string fileName = info.AsRelativeUrlTo(NetworkAgent.FileAgent.RootPath); |
|
72 | 72 |
NetworkAgent.Post(new CloudAction(CloudActionType.DeleteCloud, null, new ObjectInfo { Name = fileName }, fileState, blockSize, blockHash)); |
73 | 73 |
break; |
74 | 74 |
case FileStatus.Renamed: |
75 |
NetworkAgent.Post(new CloudAction(CloudActionType.RenameCloud, state.OldFileName, state.OldPath, state.FileName, state.Path)); |
|
75 |
NetworkAgent.Post(new CloudMoveAction(CloudActionType.RenameCloud, state.OldFileName, state.OldPath, state.FileName, state.Path));
|
|
76 | 76 |
break; |
77 | 77 |
} |
78 | 78 |
|
Also available in: Unified diff