Exemplo n.º 1
0
 internal IVirtualFile Move(FtpVirtualFile source, IVirtualDirectory destination, string destFilename)
 {
     if (destination.VirtualPathProvider == this)
     {
         var destPath = this.CombineVirtualPath(destination.VirtualPath, destFilename);
         this.ConnectedClient.RenameFile(source.VirtualPath, destPath);
         this.nodes.Remove(NormalizeAbsolutePath(source.VirtualPath));
         return(this.GetOrAddFile(destPath));
     }
     else
     {
         var copy = source.CopyTo(destination, destFilename);
         source.Delete();
         return(copy);
     }
 }
Exemplo n.º 2
0
        private FtpVirtualFile GetOrAddFile(string virtualPath)
        {
            var node = new FtpVirtualFile(this, virtualPath);

            return(this.AddOrGetNode(node));
        }