Revision ec1a1baf trunk/Pithos.Core/Agents/NetworkAgent.cs
b/trunk/Pithos.Core/Agents/NetworkAgent.cs | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
#endregion |
42 | 42 |
|
43 |
//TODO: Now there is a UUID tag. This can be used for renames/moves |
|
44 |
|
|
45 |
|
|
46 | 43 |
using System; |
47 |
using System.Collections.Concurrent; |
|
48 | 44 |
using System.Collections.Generic; |
49 | 45 |
using System.ComponentModel.Composition; |
50 | 46 |
using System.Diagnostics; |
51 | 47 |
using System.Diagnostics.Contracts; |
52 | 48 |
using System.IO; |
53 |
using System.Linq; |
|
54 | 49 |
using System.Net; |
55 | 50 |
using System.Threading; |
56 | 51 |
using System.Threading.Tasks; |
57 |
using System.Threading.Tasks.Dataflow; |
|
58 | 52 |
using Castle.ActiveRecord; |
59 | 53 |
using Pithos.Interfaces; |
60 | 54 |
using Pithos.Network; |
... | ... | |
62 | 56 |
|
63 | 57 |
namespace Pithos.Core.Agents |
64 | 58 |
{ |
65 |
//TODO: Ensure all network operations use exact casing. Pithos is case sensitive |
|
66 | 59 |
[Export] |
67 | 60 |
public class NetworkAgent |
68 | 61 |
{ |
... | ... | |
78 | 71 |
|
79 | 72 |
private static readonly ILog Log = LogManager.GetLogger("NetworkAgent"); |
80 | 73 |
|
81 |
private readonly ConcurrentBag<AccountInfo> _accounts = new ConcurrentBag<AccountInfo>(); |
|
82 |
|
|
83 | 74 |
[System.ComponentModel.Composition.Import] |
84 | 75 |
public IPithosSettings Settings { get; set; } |
85 | 76 |
|
... | ... | |
144 | 135 |
{ |
145 | 136 |
//Clear the status of already deleted files to avoid reprocessing |
146 | 137 |
if (action.LocalFile != null) |
147 |
this.StatusKeeper.ClearFileStatus(action.LocalFile.FullName);
|
|
138 |
StatusKeeper.ClearFileStatus(action.LocalFile.FullName); |
|
148 | 139 |
} |
149 | 140 |
else |
150 | 141 |
{ |
... | ... | |
676 | 667 |
var accountName = parts[1]; |
677 | 668 |
var oldName = accountInfo.UserName; |
678 | 669 |
var absoluteUri = accountInfo.StorageUri.AbsoluteUri; |
679 |
var nameIndex = absoluteUri.IndexOf(oldName); |
|
670 |
var nameIndex = absoluteUri.IndexOf(oldName, StringComparison.Ordinal);
|
|
680 | 671 |
var root = absoluteUri.Substring(0, nameIndex); |
681 | 672 |
|
682 | 673 |
accountInfo = new AccountInfo |
... | ... | |
852 | 843 |
} |
853 | 844 |
|
854 | 845 |
|
855 |
public void AddAccount(AccountInfo accountInfo) |
|
856 |
{ |
|
857 |
if (!_accounts.Contains(accountInfo)) |
|
858 |
_accounts.Add(accountInfo); |
|
859 |
} |
|
860 | 846 |
} |
861 | 847 |
|
862 | 848 |
|
Also available in: Unified diff