This commit is contained in:
2025-06-10 14:29:34 +02:00
parent 08963fe2f9
commit 3ec64dfc86
30 changed files with 816 additions and 583 deletions

View File

@@ -32,21 +32,14 @@ namespace BeWo.Data.Access
return Path.Combine(_rootPath, filePath);
}
public async Task SaveLogAsync(string pFileName, Stream content, CancellationToken cancellationToken = default)
{
var lFilePath = Path.Combine("logs", pFileName);
await SaveFileAsync(lFilePath, pFileName, content, cancellationToken).ConfigureAwait(true);
}
private async Task SaveFileAsync(string pFilePath, string pFileName, Stream content, CancellationToken cancellationToken = default)
{
// Prüfe Namen
if (SecurityUtils.ContainsInvalidFilenameChars(pFileName))
throw new BeWoInvalidOperationException(AppError.LocalFileStorageFileNameInvalidChar);
throw new BeWoInvalidOperationException(AppError.FileNameInvalidChar);
if (Path.GetFileName(pFilePath) != pFileName)
throw new BeWoInvalidOperationException(AppError.LocalFileStorageFileNameNotEqFilePath);
throw new BeWoInvalidOperationException(AppError.FileNameNotEqFilePath);
// Erstelle File Ordner
var path = GetFilePath(pFilePath);