示例#1
0
        /// <summary>
        /// Initializes a new instance of the UploadChunkRequest
        /// </summary>
        /// <param name="fabricClient"></param>
        /// <param name="remoteLocation">Get image store relative path</param>
        /// <param name="sessionId">Get the upload session ID and allow invalid session ID for negative testing scenario</param>
        /// <param name="startPosition">Get the start position of byte chunk from a uploading file</param>
        /// <param name="endPosition">Get the end position of byte chunk from a upload file</param>
        /// <param name="filePath">Get the local file to be uploaded</param>
        /// <param name="fileSize">Get the size in byte of the file to be uploaded</param>
        /// <param name="timeout"></param>
        public UploadChunkRequest(
            IFabricClient fabricClient,
            string remoteLocation,
            string sessionId,
            UInt64 startPosition,
            UInt64 endPosition,
            string filePath,
            UInt64 fileSize,
            TimeSpan timeout)
            : base(fabricClient, timeout)
        {
            ThrowIf.NullOrEmpty(remoteLocation, "remoteLocation");
            ThrowIf.NullOrEmpty(filePath, "filePath");
            ThrowIf.IsFalse(startPosition <= endPosition, "startPosition:{0},endPosition:{1}", startPosition, endPosition);

            this.RemoteLocation = remoteLocation;
            this.SessionId      = sessionId;
            this.StartPosition  = startPosition;
            this.EndPosition    = endPosition;
            this.FilePath       = filePath;
            this.FileSize       = fileSize;
        }