An encapsulation of a path used for communication between path descriptors and an IInternalFileSystem. Do not use this type in your code (unless implementing your own IInternalFileSystem).
Пример #1
0
        public void CopyFile(RootedCanonicalPath source, RootedCanonicalPath destination)
        {
            var sourceNode = FindFileNodeByPath(source.FullPath);
            var parser = new PathParser(destination.FullPath);
            var destParentNode = parser.GetParentNode(_rootNode);
            string destName = parser.GetLeafNodeName();

            sourceNode.CopyTo(destParentNode, destName);
        }
Пример #2
0
        private void MoveFileSystemItem(FileSystemNode sourceNode, RootedCanonicalPath destination)
        {
            var parser = new PathParser(destination.FullPath);
            var destParentNode = parser.GetParentNode(_rootNode);
            string destName = parser.GetLeafNodeName();

            sourceNode.MoveTo(destParentNode, destName);
        }
Пример #3
0
 public void SetFileCreationTime(RootedCanonicalPath path, DateTime at)
 {
     FindFileNodeByPath(path.FullPath).CreationTime = at;
 }
Пример #4
0
 public void SetFileLastWriteTime(RootedCanonicalPath path, DateTime at)
 {
     FindFileNodeByPath(path.FullPath).LastWriteTime = at;
 }
Пример #5
0
 public void DeleteDirectory(RootedCanonicalPath path, bool recursive)
 {
     // TODO: Tolerant if it doesn't exist; Support recursive.
     FindFolderNodeByPath(path.FullPath).Delete();
 }
Пример #6
0
 public DateTime GetDirectoryLastWriteTime(RootedCanonicalPath path)
 {
     return FindFolderNodeByPath(path.FullPath).LastWriteTime;
 }
Пример #7
0
 public bool IsFile(RootedCanonicalPath path)
 {
     return (FindFileNodeByPath(path.FullPath) != null);
 }
Пример #8
0
 public Stream CreateReadStream(RootedCanonicalPath path)
 {
     return FindFileNodeByPath(path.FullPath).CreateReadStream();
 }
Пример #9
0
 public long GetFileSize(RootedCanonicalPath path)
 {
     return FindFileNodeByPath(path.FullPath).Size;
 }
Пример #10
0
 public bool IsDirectory(RootedCanonicalPath path)
 {
     return (FindFolderNodeByPath(path.FullPath) != null);
 }
Пример #11
0
 public IEnumerable<string> GetFilesInDirectory(RootedCanonicalPath path)
 {
     return FindFolderNodeByPath(path.FullPath)
         .Children
         .OfType<FileNode>()
         .Select(child => child.FullPath);
 }
Пример #12
0
 public DateTime GetFileLastWriteTime(RootedCanonicalPath path)
 {
     return FindFileNodeByPath(path.FullPath).LastWriteTime;
 }
Пример #13
0
 public DateTime GetFileCreationTime(RootedCanonicalPath path)
 {
     return FindFileNodeByPath(path.FullPath).CreationTime;
 }
Пример #14
0
 public void CreateDirectory(RootedCanonicalPath path)
 {
     CreateDirectory(path.FullPath);
 }
Пример #15
0
 public void MoveFile(RootedCanonicalPath source, RootedCanonicalPath destination)
 {
     var sourceNode = FindFileNodeByPath(source.FullPath);
     MoveFileSystemItem(sourceNode, destination);
 }
Пример #16
0
 public Stream CreateModifyStream(RootedCanonicalPath path)
 {
     return CreateOrReuseFile(path.FullPath).CreateModifyStream();
 }
Пример #17
0
 public void SetCurrentDirectory(RootedCanonicalPath path)
 {
     _currentDirectory = path.FullPath;
 }
Пример #18
0
 public Stream CreateWriteStream(RootedCanonicalPath path)
 {
     return CreateFile(path.FullPath).CreateWriteStream();
 }
Пример #19
0
 public void SetDirectoryLastWriteTime(RootedCanonicalPath path, DateTime at)
 {
     FindFolderNodeByPath(path.FullPath).LastWriteTime = at;
 }
Пример #20
0
 public void DeleteFile(RootedCanonicalPath path)
 {
     // TODO: Tolerant if it doesn't exist.
     FindFileNodeByPath(path.FullPath).Delete();
 }
Пример #21
0
 public DateTime GetDirectoryCreationTime(RootedCanonicalPath path)
 {
     return FindFolderNodeByPath(path.FullPath).CreationTime;
 }