예제 #1
0
 public static FileDescriptor LoadFrom(MainStoragePath mainPath, string fullPath)
 {
     DateTime writeDate = File.GetLastWriteTimeUtc(fullPath);
     var info = new FileInfo(fullPath);
     long len = info.Length;
     return new FileDescriptor(mainPath.CreateRelative(fullPath), len, writeDate);
 }
예제 #2
0
 public NetworkContext(NewFileModule module, NetworkModel model, MainStoragePath mainPath)
 {
     _fileModule = module;
     _mainPath = mainPath;
     _netModel = model;
     _mainFileIndex = new MainFileIndex(this);
     _changeWatcher = new ChangeWatcher(this);
     _dispatcher = new ChangeMaster(this);
 }
 public static FileSystemObjectDescriptor New(MainStoragePath mainPath, string fullPath)
 {
     if (File.Exists(fullPath))
     {
         return FileDescriptor.LoadFrom(mainPath, fullPath);
     }
     if (Directory.Exists(fullPath))
     {
         return new FolderDescriptor(mainPath.CreateRelative(fullPath));
     }
     throw new FileNotFoundException(fullPath);
 }
예제 #4
0
 public NetworkModel(string path)
 {
     MainPath = new MainStoragePath((AbsPath) path);
     GroupList = new List<GroupModel>();
 }
예제 #5
0
 public FileTable(MainStoragePath folderPath)
 {
     this.folderPath = folderPath;
     table = new Dictionary<string, FileSystemObjectDescriptor>();
 }
예제 #6
0
 public FileTable(MainStoragePath mainPath)
     : base(mainPath)
 {
     _mainPath = mainPath;
     //_table = new Dictionary<RelPath, FsObject<RelPath>>();
     //_rootDirectory = new DirNode((Name)Path.GetFileName(mainPath.ToString()), null);
     //_indexedDirectories = new Dictionary<RelPath, DirNode>();
 }