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; }
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)); }