Esempio n. 1
0
        public static void Download(TransferMode mode, string downloadPath, string localDir, string localFileName)
        {
            switch (mode)
            {
            case TransferMode.FTP:
                //todo
                break;

            case TransferMode.COS:
                CosFacade cos = CosFacade.GetInstance("test");
                //cos.DownloadFile(downloadPath, localDir, localFileName);
                break;

            default:
                Console.WriteLine("Not supported mode!");
                return;
            }
        }
Esempio n. 2
0
        public static void UploadProject(TransferMode mode, string fileName, string projectId)
        {
            switch (mode)
            {
            case TransferMode.FTP:
                FTP ftp = new FTP();
                ftp.setRemoteHost("101.132.99.72");
                ftp.setUsername("test_ftp");
                ftp.setPassword("#Bugsfor$");

                //ftp.UploadProject(fileName, projectId, new BasicProgress<double>(p => Console.WriteLine($"{p:P2} uploaded to ftp server.")));
                break;

            case TransferMode.COS:
                CosFacade cos = GetInstance(projectId);
                cos.UploadProject(fileName, projectId, null, null, null, null);
                break;

            default:
                Console.WriteLine("Not supported mode!");
                return;
            }
        }