2using System.ComponentModel.DataAnnotations;
4using System.Threading.Tasks;
6using Microsoft.AspNetCore.Mvc;
7using Microsoft.Extensions.Logging;
45 ILogger<ApiController> logger,
49 authenticationContext,
69 public ValueTask<IActionResult>
Download([
Required, FromQuery]
string ticket, CancellationToken cancellationToken)
83 [DisableRequestSizeLimit]
84 [ProducesResponseType(204)]
86 public async ValueTask<IActionResult>
Upload([
Required, FromQuery]
string ticket, CancellationToken cancellationToken)
98 return result.ErrorCode == ErrorCode.ResourceNotPresent
Sanity limits to prevent users from overloading.
const int MaximumFileTransferSize
The maximum size for file transfers.
Represents an error message returned by the server.
Response for when file transfers are necessary.
Routes to a server actions.
const string Transfer
The transfer controller.
Base Controller for API functions.
Very similar to FileStreamResult except it's IActionResultExecutor<TResult> contains a fix for https:...
ApiController for file streaming.
ValueTask< IActionResult > Download([Required, FromQuery] string ticket, CancellationToken cancellationToken)
Downloads a file with a given ticket .
TransferController(IDatabaseContext databaseContext, IAuthenticationContext authenticationContext, IFileTransferStreamHandler fileTransferService, ILogger< ApiController > logger, IApiHeadersProvider apiHeaders)
Initializes a new instance of the TransferController class.
readonly IFileTransferStreamHandler fileTransferService
The IFileTransferStreamHandler for the TransferController.
async ValueTask< IActionResult > Upload([Required, FromQuery] string ticket, CancellationToken cancellationToken)
Uploads a file with a given ticket .
For creating and accessing authentication contexts.
Reads and writes to Streams associated with FileTicketResponses.
ValueTask< ErrorMessageResponse?> SetUploadStream(FileTicketResponse ticketResponse, Stream stream, CancellationToken cancellationToken)
Sets the Stream for a given ticketResponse associated with a pending upload.
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.
@ Required
DMAPI validation must suceed for the deployment to succeed.