Initial Argus web catalog
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
namespace Argus.Infrastructure;
|
||||
|
||||
public sealed class PackageStorageService(StoragePaths storagePaths)
|
||||
{
|
||||
public string ResolvePhysicalPath(string storedRelativePath)
|
||||
{
|
||||
var normalizedRelativePath = storedRelativePath.Replace('/', Path.DirectorySeparatorChar);
|
||||
return Path.Combine(storagePaths.PackagesRootPath, normalizedRelativePath);
|
||||
}
|
||||
|
||||
public void TryDelete(string storedRelativePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var physicalPath = ResolvePhysicalPath(storedRelativePath);
|
||||
if (File.Exists(physicalPath))
|
||||
{
|
||||
File.Delete(physicalPath);
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user