/// <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()); }
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()); }