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); }
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); }
public void SetFileCreationTime(RootedCanonicalPath path, DateTime at) { FindFileNodeByPath(path.FullPath).CreationTime = at; }
public void SetFileLastWriteTime(RootedCanonicalPath path, DateTime at) { FindFileNodeByPath(path.FullPath).LastWriteTime = at; }
public void DeleteDirectory(RootedCanonicalPath path, bool recursive) { // TODO: Tolerant if it doesn't exist; Support recursive. FindFolderNodeByPath(path.FullPath).Delete(); }
public DateTime GetDirectoryLastWriteTime(RootedCanonicalPath path) { return FindFolderNodeByPath(path.FullPath).LastWriteTime; }
public bool IsFile(RootedCanonicalPath path) { return (FindFileNodeByPath(path.FullPath) != null); }
public Stream CreateReadStream(RootedCanonicalPath path) { return FindFileNodeByPath(path.FullPath).CreateReadStream(); }
public long GetFileSize(RootedCanonicalPath path) { return FindFileNodeByPath(path.FullPath).Size; }
public bool IsDirectory(RootedCanonicalPath path) { return (FindFolderNodeByPath(path.FullPath) != null); }
public IEnumerable<string> GetFilesInDirectory(RootedCanonicalPath path) { return FindFolderNodeByPath(path.FullPath) .Children .OfType<FileNode>() .Select(child => child.FullPath); }
public DateTime GetFileLastWriteTime(RootedCanonicalPath path) { return FindFileNodeByPath(path.FullPath).LastWriteTime; }
public DateTime GetFileCreationTime(RootedCanonicalPath path) { return FindFileNodeByPath(path.FullPath).CreationTime; }
public void CreateDirectory(RootedCanonicalPath path) { CreateDirectory(path.FullPath); }
public void MoveFile(RootedCanonicalPath source, RootedCanonicalPath destination) { var sourceNode = FindFileNodeByPath(source.FullPath); MoveFileSystemItem(sourceNode, destination); }
public Stream CreateModifyStream(RootedCanonicalPath path) { return CreateOrReuseFile(path.FullPath).CreateModifyStream(); }
public void SetCurrentDirectory(RootedCanonicalPath path) { _currentDirectory = path.FullPath; }
public Stream CreateWriteStream(RootedCanonicalPath path) { return CreateFile(path.FullPath).CreateWriteStream(); }
public void SetDirectoryLastWriteTime(RootedCanonicalPath path, DateTime at) { FindFolderNodeByPath(path.FullPath).LastWriteTime = at; }
public void DeleteFile(RootedCanonicalPath path) { // TODO: Tolerant if it doesn't exist. FindFileNodeByPath(path.FullPath).Delete(); }
public DateTime GetDirectoryCreationTime(RootedCanonicalPath path) { return FindFolderNodeByPath(path.FullPath).CreationTime; }