Example #1
0
        internal void RenameFileOnServer(FtpClient ftpClient, DFtpFile file, String newName)
        {
            DFtpFile   remoteSelection = file;
            DFtpAction action          = new RenameFileRemoteAction(ftpClient, test_Dir, remoteSelection, newName);
            DFtpResult result          = action.Run();

            return;
        }
Example #2
0
        public DFtpResult Go()
        {
            String newName = IOHelper.AskString("Enter replacement name:");
            // Create the action
            // Initialize it with the info we've collected
            DFtpAction action = new RenameFileRemoteAction(Client.ftpClient, Client.remoteDirectory, Client.remoteSelection, newName);

            // Carry out the action and get the result
            DFtpResult result = action.Run();

            if (result.Type == DFtpResultType.Ok)
            {
                IOHelper.Message("The file was successfully renamed to '" + newName + "'.");
                Client.remoteSelection = null;
            }

            return(result);
        }