tgstation-server 6.17.0
The /tg/station 13 server suite
|
Public Member Functions | |||||
FileDownloader (IAbstractHttpClientFactory httpClientFactory, ILogger< FileDownloader > logger) | |||||
Initializes a new instance of the FileDownloader class. | |||||
IFileStreamProvider | DownloadFile (Uri url, string? bearerToken) | ||||
Downloads a file from a given url .
| |||||
Private Attributes | |
readonly IAbstractHttpClientFactory | httpClientFactory |
The IAbstractHttpClientFactory for the FileDownloader. | |
readonly ILogger< FileDownloader > | logger |
The ILogger for the FileDownloader. | |
Definition at line 13 of file FileDownloader.cs.
Tgstation.Server.Host.IO.FileDownloader.FileDownloader | ( | IAbstractHttpClientFactory | httpClientFactory, |
ILogger< FileDownloader > | logger | ||
) |
Initializes a new instance of the FileDownloader class.
httpClientFactory | The value of httpClientFactory. |
logger | The value of logger. |
Definition at line 30 of file FileDownloader.cs.
References Tgstation.Server.Host.IO.FileDownloader.httpClientFactory, and Tgstation.Server.Host.IO.FileDownloader.logger.
IFileStreamProvider Tgstation.Server.Host.IO.FileDownloader.DownloadFile | ( | Uri | url, |
string? | bearerToken | ||
) |
Downloads a file from a given url .
url | The URL to download. |
bearerToken | Optional string to use as the "Bearer" value in the optional "Authorization" header for the request. |
Implements Tgstation.Server.Host.IO.IFileDownloader.
Definition at line 37 of file FileDownloader.cs.
References Tgstation.Server.Api.ApiHeaders.BearerAuthenticationScheme, Tgstation.Server.Common.Http.IAbstractHttpClientFactory.CreateClient(), Tgstation.Server.Host.IO.FileDownloader.httpClientFactory, and Tgstation.Server.Host.IO.FileDownloader.logger.
|
private |
The IAbstractHttpClientFactory for the FileDownloader.
Definition at line 18 of file FileDownloader.cs.
Referenced by Tgstation.Server.Host.IO.FileDownloader.DownloadFile(), and Tgstation.Server.Host.IO.FileDownloader.FileDownloader().
|
private |
The ILogger for the FileDownloader.
Definition at line 23 of file FileDownloader.cs.
Referenced by Tgstation.Server.Host.IO.FileDownloader.DownloadFile(), and Tgstation.Server.Host.IO.FileDownloader.FileDownloader().