Beispiel #1
0
        /// <summary>
        /// Migrates the file.
        /// </summary>
        /// <param name="file">file to migrate</param>
        /// <param name="specification">specifications for the migration</param>
        /// <param name="targetWeb">the target web</param>
        internal void MigrateFile(File file, FileMigrationSpecification specification, Web targetWeb)
        {
            SharePoint2010And2013Downloader downloader = new SharePoint2010And2013Downloader(specification);
            SharePoint2010And2013Uploader   uploader   = new SharePoint2010And2013Uploader(specification.TargetClientContext);

            try
            {
                MigrationFile migrationFile = downloader.DownloadDocument(file);
                Console.WriteLine("downloaded file '{0}'.", migrationFile.File.Name);
                //// specification.Logger.AddMessage(string.Format("downloaded file '{0}'.", migrationFile.File.Name));
                Thread.Sleep(this.GetWaitingTime(specification.Bandwith));
                uploader.UploadDocument(migrationFile, targetWeb);
                Console.WriteLine("uploaded file '{0}'.", migrationFile.File.Name);
                ////specification.Logger.AddMessage(string.Format("uploaded file '{0}'.", migrationFile.File.Name));
            }
            catch (OperationCanceledException e)
            {
                Console.WriteLine("Exception: {0}", e.Message);
                //// specification.Logger.AddMessage(string.Format("Exception: {0}", e.Message));
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SharePoint2010And2013Migrator"/> class.
        /// </summary>
        /// <param name="fileMigrationSpecification">instance of the FileMigrationSpecification</param>
        internal SharePoint2010And2013Migrator(FileMigrationSpecification fileMigrationSpecification)
        {
            this.fileMigrationSpecification = fileMigrationSpecification;

            this.SpecifySharePointSpecification();
        }
Beispiel #3
0
 /// <summary>
 /// Prevents a default instance of the <see cref="FileMigrationBuilder" /> class from being created.
 /// </summary>
 private FileMigrationBuilder()
 {
     this.specification = new FileMigrationSpecification();
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SharePoint2010And2013Downloader"/> class.
 /// </summary>
 /// <param name="specification">the FileMigrationSpecification</param>
 public SharePoint2010And2013Downloader(FileMigrationSpecification specification)
 {
     this.specification = specification;
 }