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