Beispiel #1
0
        private async Task CleanFilesAsync(string schemaName, string directoryName, string dumpFileName, CancellationToken cancellationToken)
        {
            var filter = dumpFileName?.Replace("~partno~", "*");

            var files = await _dbFileService.GetFilesAsync(directoryName, cancellationToken);
            var fileNames = files.Select(x => x.FileName);

            var schemaFileNames = FileMaskUtils.FileNamesMatchingFilter(fileNames, filter);

            foreach (var schemaFileName in schemaFileNames)
            {
                await _dbFileService.DeleteFileAsync(schemaFileName, directoryName, cancellationToken);
            }
        }
 public async Task <IEnumerable <object> > GetFiles(CancellationToken cancellationToken, [FromQuery] string directoryName)
 {
     return(await _dbFileService.GetFilesAsync(directoryName, cancellationToken));
 }