public IActionResult GetBatchStatus([FromRoute, Required] string batchId) { if (!string.IsNullOrEmpty(batchId)) { BatchStatusResponse batchStatusResponse = fileShareService.GetBatchStatus(batchId, configuration["HOME"]); if (batchStatusResponse.Status == "Committed") { return(new OkObjectResult(batchStatusResponse)); } } return(Unauthorized()); }
public BatchStatusResponse GetBatchStatus(string batchId, string homeDirectoryPath) { BatchStatusResponse batchStatusResponse = new BatchStatusResponse(); string folderName = fileShareServiceConfiguration.Value.FolderDirectoryName; string batchFolderPath = Path.Combine(homeDirectoryPath, folderName, batchId); if (FileHelper.ValidateFilePath(batchFolderPath) && FileHelper.CheckFolderExists(batchFolderPath)) { batchStatusResponse.BatchId = batchId; batchStatusResponse.Status = "Committed"; } return(batchStatusResponse); }