protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            var newFile = directory.CopyFile(this, name);

            this.Delete();
            return(newFile);
        }
 protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     if (directory is FileSystemVirtualDirectory)
     {
         var copyFInfo = BackingFile.CopyTo(Path.Combine(directory.RealPath, name), true);
         return new FileSystemVirtualFile(VirtualPathProvider, directory, copyFInfo);
     }
     else
     {
         return directory.CopyFile(this, name);
     }
 }
Example #3
0
 protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     if (directory is FileSystemVirtualDirectory)
     {
         var copyFInfo = BackingFile.CopyTo(Path.Combine(directory.RealPath, name), true);
         return(new FileSystemVirtualFile(VirtualPathProvider, directory, copyFInfo));
     }
     else
     {
         return(directory.CopyFile(this, name));
     }
 }
Example #4
0
 protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     if (directory is FileSystemVirtualDirectory)
     {
         BackingFile.MoveTo(Path.Combine(directory.RealPath, name));
         return(new FileSystemVirtualFile(VirtualPathProvider, directory, BackingFile));
     }
     else
     {
         var newFile = directory.CopyFile(this, name);
         this.Delete();
         return(newFile);
     }
 }
Example #5
0
        protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is DropboxVirtualDirectory)
            {
                var dir = (DropboxVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    Provider.Copy(this.VirtualPath, Provider.CombineVirtualPath(directory.VirtualPath, name));
                    return(new DropboxVirtualFile(Provider, dir, name));
                }
            }

            // TODO: copy cross Dropboxes using CopyRef?

            return(directory.CopyFile(this, name));
        }
        protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is DropboxVirtualDirectory)
            {
                var dir = (DropboxVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    Provider.Copy(this.VirtualPath, Provider.CombineVirtualPath(directory.VirtualPath, name));
                    return new DropboxVirtualFile(Provider, dir, name);
                }
            }

            // TODO: copy cross Dropboxes using CopyRef?

            return directory.CopyFile(this, name);
        }
Example #7
0
        protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is DropboxVirtualDirectory)
            {
                var dir = (DropboxVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    Provider.Move(this.VirtualPath, Provider.CombineVirtualPath(directory.VirtualPath, name));
                    ((DropboxVirtualDirectory)Directory).RemoveFromContents(this);
                    return(new DropboxVirtualFile(Provider, dir, name));
                }
            }

            var newFile = directory.CopyFile(this, name);

            this.Delete();
            return(newFile);
        }
        protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is SftpVirtualDirectory)
            {
                var dir = (SftpVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    ((SftpVirtualDirectory)this.Directory).RemoveFromCache(this);
                    File.Value.MoveTo(Provider.CombineVirtualPath(directory.VirtualPath, name));
                    return(new SftpVirtualFile(Provider, dir, name, DateTime.Now));
                }
            }

            var newFile = directory.CopyFile(this, name);

            this.Delete();
            return(newFile);
        }
Example #9
0
        protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is FtpVirtualDirectory)
            {
                var dir = (FtpVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    var currentDir = (FtpVirtualDirectory)this.Directory;
                    currentDir.RemoveFromContents(this.Name);
                    Provider.Rename(this.VirtualPath, Provider.CombineVirtualPath(dir.VirtualPath, name));
                    return new FtpVirtualFile(Provider, dir, name, DateTime.Now);
                }
            }

            var newFile = directory.CopyFile(this, name);
            this.Delete();
            return newFile;
        }
Example #10
0
 protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     return(directory.CopyFile(this, name));
 }
        protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is DropboxVirtualDirectory)
            {
                var dir = (DropboxVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    Provider.Move(this.VirtualPath, Provider.CombineVirtualPath(directory.VirtualPath, name));
                    ((DropboxVirtualDirectory)Directory).RemoveFromContents(this);
                    return new DropboxVirtualFile(Provider, dir, name);
                }
            }

            var newFile = directory.CopyFile(this, name);
            this.Delete();
            return newFile;
        }
Example #12
0
 public IVirtualFile CopyTo(IVirtualDirectory destination, string destFilename)
 {
     return(destination.CopyFile(this, destFilename));
 }
 protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     var newFile = directory.CopyFile(this, name);
     this.Delete();
     return newFile;
 }
 protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     if (directory is FileSystemVirtualDirectory)
     {
         BackingFile.MoveTo(Path.Combine(directory.RealPath, name));
         return new FileSystemVirtualFile(VirtualPathProvider, directory, BackingFile);
     }
     else
     {
         var newFile = directory.CopyFile(this, name);
         this.Delete();
         return newFile;
     }
 }
Example #15
0
 protected override IVirtualFile CopyBackingFileToDirectory(IVirtualDirectory directory, string name)
 {
     return directory.CopyFile(this, name);
 }
Example #16
0
        protected override IVirtualFile MoveBackingFileToDirectory(IVirtualDirectory directory, string name)
        {
            if (directory is SftpVirtualDirectory)
            {
                var dir = (SftpVirtualDirectory)directory;
                if (dir.Provider == this.Provider)
                {
                    ((SftpVirtualDirectory)this.Directory).RemoveFromCache(this);
                    File.Value.MoveTo(Provider.CombineVirtualPath(directory.VirtualPath, name));
                    return new SftpVirtualFile(Provider, dir, name, DateTime.Now);
                }
            }

            var newFile = directory.CopyFile(this, name);
            this.Delete();
            return newFile;
        }
Example #17
0
 public static IVirtualFile CopyFile(this IVirtualDirectory directory, IVirtualFile file)
 {
     return(directory.CopyFile(file, file.Name));
 }