Ejemplo n.º 1
0
        public void FileDeleteTest()
        {
            IEntry entry = FileFactory.CreateEntry(@"C:\ForFileManager\ToDeleteByFile1.txt");

            MyFile.Delete(entry.FullName);
            Assert.IsFalse(MyFile.Exists(@"C:\ForFileManager\ToDeleteByFile1.txt"));
        }
Ejemplo n.º 2
0
        public override IFileMoveProcess Move(MyFile file, bool keepOriginal)
        {
            if (!file.Exists())
            {
                throw new FileNotFoundException();
            }

            return(new FtpFileMoveProcess(file, keepOriginal, Client));
        }
        public void To(MyFile destFile)
        {
            if (destFile.Exists())
            {
                throw new FileAlreadyExistException();
            }

            if (File is WinFile)
            {
                MoveFile((TextFile)destFile);
            }
            else if (File is WinFolder)
            {
                var folder = (WinFolder)File;
                FolderCopier.Copy(folder, (Folder)destFile, MoveFile);
            }
            else
            {
                throw new ArgumentException();
            }
        }