public FtpPurgeRemoteData(IFtpListDirectoryOnRemote ftpListDirectoryOnRemote, IFtpRemoveDirectory ftpRemoveDirectory,
                           int retentionDays, string remoteBasePath)
 {
     RetentionDays            = retentionDays;
     RemoteBasePath           = remoteBasePath;
     FtpListDirectoryOnRemote = ftpListDirectoryOnRemote;
     FtpRemoveDirectory       = ftpRemoveDirectory;
 }
        public FtpPurgeRemoteDataTests()
        {
            _remoteFtpServer = "ftp://192.168.0.185";
            _remoteFtpUsr    = "******";
            _remoteFtpPwd    = "carl";
            _remoteRetention = 60;
            _remoteBasePath  = "MySQL";

            var ftpListDirectory = new FtpListDirectory(
                _remoteFtpServer,
                _remoteFtpUsr,
                _remoteFtpPwd
                );

            var ftpDeleteFile = new FtpDeleteFile(
                _remoteFtpServer,
                _remoteFtpUsr,
                _remoteFtpPwd,
                new Logger()
                );

            _ftpListDirectoryOnRemote = new FtpListDirectoryOnRemote()
            {
                FtpListDirectory = ftpListDirectory,
                FtpDeleteFile    = ftpDeleteFile
            };

            var _ftpRemoveDirectory = new FtpRemoveDirectory(
                _remoteFtpServer,
                _remoteFtpUsr,
                _remoteFtpPwd,
                new Logger()
                );

            _ftpPurgeRemoteData = new FtpPurgeRemoteData(
                _ftpListDirectoryOnRemote,
                _ftpRemoveDirectory,
                _remoteRetention,
                _remoteBasePath);

            _ftpMakeDirectory = new FtpMakeDirectory(
                _remoteFtpServer,
                _remoteFtpUsr,
                _remoteFtpPwd,
                new Logger());

            _ftpSendFile = new FtpSendFile(
                _remoteFtpUsr,
                _remoteFtpPwd,
                new Logger());
        }
Example #3
0
        public EntryPoint(
            ICreatePath createPath, IClearPath clearPath, IDatabaseDump databaseDump, IZipAndMove zipAndMove, IPurgeLocal purgeLocal,
            IFtpCreateRemotePath ftpCreateRemotePath, IFtpSendFileToRemote ftpSendFileToRemote, IFtpListDirectoryOnRemote ftpListDirectoryOnRemote,
            IFtpPurgeRemoteData ftpPurgeRemoteData, string backupPath, string backupPathTemp, string remoteBasePath, StringCollection dbList)
        {
            _createPath               = createPath;
            _clearPath                = clearPath;
            _databaseDump             = databaseDump;
            _zipAndMove               = zipAndMove;
            _purgeLocal               = purgeLocal;
            _ftpCreateRemotePath      = ftpCreateRemotePath;
            _ftpSendFileToRemote      = ftpSendFileToRemote;
            _ftpListDirectoryOnRemote = ftpListDirectoryOnRemote;
            _ftpPurgeRemoteData       = ftpPurgeRemoteData;

            _backupPath     = backupPath;
            _backupPathTemp = backupPathTemp;
            _remoteBasePath = remoteBasePath;

            _dbList = dbList;
        }