Example #1
0
        private static bool MeetsMinimumSize(UploadConfiguration configuration, long contentLength)
        {
            if (contentLength > MAX_SUPPORTED_CONTENT_LENGTH)
            {
                throw new ArgumentException("Object Size greater than 10TiB is not supported");
            }
            long min = configuration.LengthPerUploadPartInMiB * MiB;

            return(contentLength >= min);
        }
 public UploadManager(ObjectStorageClient objectStorageClient, UploadConfiguration uploadConfiguration)
 {
     this._osClient      = objectStorageClient;
     this._configuration = uploadConfiguration;
 }
Example #3
0
        public static readonly long MAX_SUPPORTED_CONTENT_LENGTH = 10 * MiB * MiB; // 10 TiB

        /// <summary>
        /// Method to determine if an upload meets multipart upload requirement based on uploadconfiguration and content length.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="contentLength"></param>
        /// <returns>True if an upload configuration satifies the requirements otherwise false.</returns>
        public static bool ShouldUseMultipart(UploadConfiguration configuration, long contentLength)
        {
            return(configuration.AllowMultipartUploads && MeetsMinimumSize(configuration, contentLength));
        }