Beispiel #1
0
        public static void Copy(IBlogFileUploadSettings source, IBlogFileUploadSettings destination)
        {
            // create typesafe wrappers for source and destination
            FtpUploaderSettings sourceSettings      = new FtpUploaderSettings(source);
            FtpUploaderSettings destinationSettings = new FtpUploaderSettings(destination);

            // copy the values
            destinationSettings.FtpServer   = sourceSettings.FtpServer;
            destinationSettings.PublishPath = sourceSettings.PublishPath;
            destinationSettings.UrlMapping  = sourceSettings.UrlMapping;
            destinationSettings.Username    = sourceSettings.Username;
            destinationSettings.Password    = sourceSettings.Password;
        }
Beispiel #2
0
        static string GetFileUploadDestinationContext(string blogId, FileUploadSupport fileUploadSupport, IBlogFileUploadSettings uploadSettings)
        {
            switch (fileUploadSupport)
            {
            case FileUploadSupport.Weblog:
                return(blogId);

            case FileUploadSupport.FTP:
                FtpUploaderSettings ftpSettings = new FtpUploaderSettings(uploadSettings);
                return(String.Format(CultureInfo.InvariantCulture, "ftp://{0}@{1}{2}", ftpSettings.Username, ftpSettings.FtpServer, ftpSettings.PublishPath));

            default:
                Trace.Fail("Unexpected value for fileUploadSupport: " + fileUploadSupport.ToString());
                goto case FileUploadSupport.Weblog;
            }
        }
        public static void Copy(IBlogFileUploadSettings source, IBlogFileUploadSettings destination)
        {
            // create typesafe wrappers for source and destination
            FtpUploaderSettings sourceSettings = new FtpUploaderSettings(source);
            FtpUploaderSettings destinationSettings = new FtpUploaderSettings(destination);

            // copy the values
            destinationSettings.FtpServer = sourceSettings.FtpServer;
            destinationSettings.PublishPath = sourceSettings.PublishPath;
            destinationSettings.UrlMapping = sourceSettings.UrlMapping;
            destinationSettings.Username = sourceSettings.Username;
            destinationSettings.Password = sourceSettings.Password;
        }
 public FTPBlogFileUploader(string destinationContext, string postContext, FtpUploaderSettings settings, string blogId)
     : base(destinationContext, postContext, blogId)
 {
     _settings = settings;
 }
        static string GetFileUploadDestinationContext(string blogId, FileUploadSupport fileUploadSupport, IBlogFileUploadSettings uploadSettings)
        {
            switch (fileUploadSupport)
            {
                case FileUploadSupport.Weblog:
                    return blogId;

                case FileUploadSupport.FTP:
                    FtpUploaderSettings ftpSettings = new FtpUploaderSettings(uploadSettings);
                    return String.Format(CultureInfo.InvariantCulture, "ftp://{0}@{1}{2}", ftpSettings.Username, ftpSettings.FtpServer, ftpSettings.PublishPath);

                default:
                    Trace.Fail("Unexpected value for fileUploadSupport: " + fileUploadSupport.ToString());
                    goto case FileUploadSupport.Weblog;
            }
        }
Beispiel #6
0
 public FTPBlogFileUploader(string destinationContext, string postContext, FtpUploaderSettings settings, string blogId)
     : base(destinationContext, postContext, blogId)
 {
     _settings = settings;
 }