mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Delegate file deletion to ImportTask
to allow overriding it
This commit is contained in:
parent
f87bb589a2
commit
f8537c1cbe
@ -51,6 +51,15 @@ namespace osu.Game.Database
|
|||||||
: getReaderFrom(Path);
|
: getReaderFrom(Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes the file that is encapsulated by this <see cref="ImportTask"/>.
|
||||||
|
/// </summary>
|
||||||
|
public virtual void DeleteFile()
|
||||||
|
{
|
||||||
|
if (File.Exists(Path))
|
||||||
|
File.Delete(Path);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an <see cref="ArchiveReader"/> from a stream.
|
/// Creates an <see cref="ArchiveReader"/> from a stream.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -201,8 +201,8 @@ namespace osu.Game.Database
|
|||||||
// TODO: Add a check to prevent files from storage to be deleted.
|
// TODO: Add a check to prevent files from storage to be deleted.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (import != null && File.Exists(task.Path) && ShouldDeleteArchive(task.Path))
|
if (import != null && ShouldDeleteArchive(task.Path))
|
||||||
File.Delete(task.Path);
|
task.DeleteFile();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user