private Dictionary<WatcherChangeTypes, FileStatus> _statusDict = new Dictionary<WatcherChangeTypes, FileStatus>
- {
+ {
{WatcherChangeTypes.Created,FileStatus.Created},
{WatcherChangeTypes.Changed,FileStatus.Modified},
{WatcherChangeTypes.Deleted,FileStatus.Deleted},
{WatcherChangeTypes.Renamed,FileStatus.Renamed}
};
- private Dictionary<string,string> _ignoreFiles=new Dictionary<string, string>();
+ private Dictionary<string, string> _ignoreFiles=new Dictionary<string, string>();
private WorkflowState UpdateFileStatus(WorkflowState state)
{
return false;
}
+ public static FileAgent GetFileAgent(AccountInfo accountInfo)
+ {
+ return GetFileAgent(accountInfo.AccountPath);
+ }
+
+ public static FileAgent GetFileAgent(string rootPath)
+ {
+ return AgentLocator<FileAgent>.Get(rootPath.ToLower());
+ }
+
+
public FileSystemInfo GetFileSystemInfo(string relativePath)
{
if (String.IsNullOrWhiteSpace(relativePath))
foreach (var objectInfo in cloudFiles)\r
{\r
var relativePath = objectInfo.RelativeUrlToFilePath(accountInfo.UserName);\r
- var item = GetFileAgent(accountInfo).GetFileSystemInfo(relativePath);\r
+ var item = FileAgent.GetFileAgent(accountInfo).GetFileSystemInfo(relativePath);\r
if (item.Exists)\r
{\r
if ((item.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)\r
if (changes == null)\r
throw new ArgumentNullException();\r
Contract.EndContractBlock();\r
- var fileAgent = GetFileAgent(accountInfo);\r
+ var fileAgent = FileAgent.GetFileAgent(accountInfo);\r
\r
//In order to avoid multiple iterations over the files, we iterate only once\r
//over the remote files\r
if (creates == null)\r
throw new ArgumentNullException();\r
Contract.EndContractBlock();\r
- var fileAgent = GetFileAgent(accountInfo);\r
+ var fileAgent = FileAgent.GetFileAgent(accountInfo);\r
\r
//In order to avoid multiple iterations over the files, we iterate only once\r
//over the remote files\r
}\r
}\r
\r
- private static FileAgent GetFileAgent(AccountInfo accountInfo)\r
- {\r
- return AgentLocator<FileAgent>.Get(accountInfo.AccountPath);\r
- }\r
-\r
private void ProcessTrashedFiles(AccountInfo accountInfo, IEnumerable<ObjectInfo> trashObjects)\r
{\r
- var fileAgent = GetFileAgent(accountInfo);\r
+ var fileAgent = FileAgent.GetFileAgent(accountInfo);\r
foreach (var trashObject in trashObjects)\r
{\r
var barePath = trashObject.RelativeUrlToFilePath(accountInfo.UserName);\r
Directory.CreateDirectory(path);\r
}\r
}\r
-\r
}\r
}\r