Implements file system path existence check

This commit is contained in:
BinaryAlley committed 2024-09-20 19:40:17 +03:00
1 parent dc47386726
commit c29d829c91
16 files changed
+452 -125

No files matched your search

@@ -109,5 +109,17 @@ public class PathController : ApiController
PathValidResponse result = await _mediator.Send(new ValidatePathQuery(path), cancellationToken).ConfigureAwait(false);
return Ok(result);
}
/// <summary>
/// Checks whether <paramref name="path"/> exists or not.
/// </summary>
/// <param name="path">The path to be checked.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("check-path-exists")]
public async Task<IActionResult> CheckPathExists([FromQuery, ModelBinder(typeof(UrlStringBinder))] string path, CancellationToken cancellationToken)
{
PathExistsResponse result = await _mediator.Send(new CheckPathExistsQuery(path), cancellationToken).ConfigureAwait(false);
return Ok(result);
}
#endregion
}