예제 #1
0
        protected AsyncUploaderBase(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, IPlatformFile file, FileUploaderConfig config = null, int? expirationDays = null)
            : base(client, uploadSpecificationRequest, file, expirationDays)
        {
            Config = config ?? new FileUploaderConfig();

            HashProvider = MD5HashProviderFactory.GetHashProvider().CreateHash();
        }
 public AsyncScalingFileUploader(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, IPlatformFile file, FileUploaderConfig config = null, int? expirationDays = null)
     : base(client, uploadSpecificationRequest, file, config, expirationDays)
 {
     UploadSpecificationRequest.Raw = true;
     var chunkConfig = config != null ? config.PartConfig : new FilePartConfig();
     partUploader = new ScalingPartUploader(chunkConfig, Config.NumberOfThreads,
         ExecuteChunkUploadMessage,
         OnProgress);        
 }
예제 #3
0
 public ScalingFileUploader(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, IPlatformFile file, FileUploaderConfig config = null, int? expirationDays = null)
     : base(client, uploadSpecificationRequest, file, config, expirationDays)
 {
     UploadSpecificationRequest.Raw = true;
     var partConfig = config != null ? config.PartConfig : new FilePartConfig();
     partUploader = new ScalingPartUploader(partConfig, Config.NumberOfThreads,
         requestMessage => Task.Factory.StartNew(() => ExecuteChunkUploadMessage(requestMessage)),
         OnProgress);
 }
 public StandardFileUploader(
     ShareFileClient client,
     UploadSpecificationRequest uploadSpecificationRequest,
     Stream stream,
     FileUploaderConfig config = null,
     int?expirationDays        = null)
     : base(client, uploadSpecificationRequest, stream, config, expirationDays)
 {
 }
 public StandardFileUploader(
     ShareFileClient client,
     UploadSpecification uploadSpecification,
     UploadSpecificationRequest uploadSpecificationRequest,
     Stream stream,
     FileUploaderConfig config = null)
     : this(client, uploadSpecificationRequest, stream, config, expirationDays : null)
 {
     UploadSpecification = uploadSpecification;
 }
예제 #6
0
 protected AsyncUploaderBase(
     ShareFileClient client,
     UploadSpecificationRequest uploadSpecificationRequest,
     Stream stream,
     FileUploaderConfig config = null,
     int?expirationDays        = null)
     : base(client, uploadSpecificationRequest, stream, config, expirationDays)
 {
     HashProvider = MD5HashProviderFactory.GetHashProvider().CreateHash();
 }
 public AsyncScalingFileUploader(
     ShareFileClient client,
     ActiveUploadState activeUploadState,
     UploadSpecificationRequest uploadSpecificationRequest,
     Stream stream,
     FileUploaderConfig config = null)
     : this(client, uploadSpecificationRequest, stream, config)
 {
     this.activeUploadState = activeUploadState;
     UploadSpecification    = activeUploadState.UploadSpecification;
 }
 public AsyncMemoryMappedFileUploader(
     ShareFileClient client,
     UploadSpecificationRequest uploadSpecificationRequest,
     FileStream stream,
     FileUploaderConfig config           = null,
     ActiveUploadState activeUploadState = null,
     int?expirationDays = default(int?))
     : base(client, uploadSpecificationRequest, stream, config, expirationDays)
 {
     hasher = new FileChunkHasher(HashProvider);
     if (activeUploadState != null)
     {
         initialPosition     = activeUploadState.BytesUploaded;
         UploadSpecification = activeUploadState.UploadSpecification; // what happens if the new UploadSpecRequest disagrees with this?
     }
 }
        public AsyncScalingFileUploader(
            ShareFileClient client,
            UploadSpecificationRequest uploadSpecificationRequest,
            Stream stream,
            FileUploaderConfig config = null,
            int?expirationDays        = null)
            : base(client, uploadSpecificationRequest, stream, config, expirationDays)
        {
            var chunkConfig = config != null ? config.PartConfig : new FilePartConfig();

            partUploader = new ScalingPartUploader(
                chunkConfig,
                Config.NumberOfThreads,
                ExecuteChunkUploadMessage,
                progressReporter.ReportProgress,
                client.Logging);
        }
예제 #10
0
        public ScalingFileUploader(
            ShareFileClient client,
            UploadSpecificationRequest uploadSpecificationRequest,
            Stream stream,
            FileUploaderConfig config = null,
            int?expirationDays        = null)
            : base(client, uploadSpecificationRequest, stream, config, expirationDays)
        {
            var partConfig = config != null ? config.PartConfig : new FilePartConfig();

            partUploader = new ScalingPartUploader(
                partConfig,
                Config.NumberOfThreads,
                (requestMessage, cancelToken) => Task.Factory.StartNew(() => ExecuteChunkUploadMessage(requestMessage, cancelToken)),
                progressReporter.ReportProgress,
                client.Logging);
        }
예제 #11
0
        protected AsyncUploaderBase(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, IPlatformFile file, FileUploaderConfig config = null, int?expirationDays = null)
            : base(client, uploadSpecificationRequest, file, expirationDays)
        {
            Config = config ?? new FileUploaderConfig();

            HashProvider = MD5HashProviderFactory.GetHashProvider().CreateHash();
        }
 public AsyncStandardFileUploader(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, IPlatformFile file, FileUploaderConfig config = null, int?expirationDays = null)
     : base(client, uploadSpecificationRequest, file, config, expirationDays)
 {
     UploadSpecificationRequest.Raw = false;
 }
 public AsyncStandardFileUploader(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, IPlatformFile file, FileUploaderConfig config = null, int? expirationDays = null) 
     : base(client, uploadSpecificationRequest, file, config, expirationDays)
 {
     UploadSpecificationRequest.Raw = true;
 }
예제 #14
0
        public AsyncScalingFileUploader(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, IPlatformFile file, FileUploaderConfig config = null, int?expirationDays = null)
            : base(client, uploadSpecificationRequest, file, config, expirationDays)
        {
            UploadSpecificationRequest.Raw = true;
            var chunkConfig = config != null ? config.PartConfig : new FilePartConfig();

            partUploader = new ScalingPartUploader(chunkConfig, Config.NumberOfThreads,
                                                   ExecuteChunkUploadMessage,
                                                   OnProgress);
        }
예제 #15
0
        protected UploaderBase(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, Stream stream, FileUploaderConfig config, int?expirationDays)
        {
            Client = client;
            UploadSpecificationRequest = uploadSpecificationRequest;
            FileStream = stream;
            Config     = config ?? new FileUploaderConfig();
            if (uploadSpecificationRequest.FileSize != stream.Length)
            {
                throw new UploadException("Specified file size does not equal file stream length", UploadStatusCode.Unknown);
            }

            ExpirationDays   = expirationDays;
            progressReporter = new TransferProgressReporter(uploadSpecificationRequest.FileSize, Guid.NewGuid().ToString(), Config.ProgressReportInterval);
        }
예제 #16
0
        public ScalingFileUploader(ShareFileClient client, UploadSpecificationRequest uploadSpecificationRequest, IPlatformFile file, FileUploaderConfig config = null, int?expirationDays = null)
            : base(client, uploadSpecificationRequest, file, config, expirationDays)
        {
            UploadSpecificationRequest.Raw = true;
            var partConfig = config != null ? config.PartConfig : new FilePartConfig();

            partUploader = new ScalingPartUploader(partConfig, Config.NumberOfThreads,
                                                   requestMessage => Task.Factory.StartNew(() => ExecuteChunkUploadMessage(requestMessage)),
                                                   OnProgress);
        }