Beispiel #1
0
        /// <summary>
        /// RelPath must be relative to rootDirectory
        /// </summary>
        /// <param name="descriptor"></param>
        public void AddFile(FsFile<RelPath> descriptor)
        {
            DirNode parent = GetParentDir(descriptor.Path);

            parent.AddFile(descriptor.NewAsName());
        }
Beispiel #2
0
 public void ChangeFile(FsFile<RelPath> newFile)
 {
     DirNode node = GetNode(newFile.Path.GetAncestorFolders());
     if(!node.Remove(newFile.Path.FileName()))
     {
         throw new KeyNotFoundException();
     }
     node.AddFile(newFile.NewAsName());
 }