mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
27 lines
690 B
C#
27 lines
690 B
C#
|
using System.Threading.Tasks;
|
|||
|
using Wabbajack.Common;
|
|||
|
|
|||
|
namespace Wabbajack.VirtualFileSystem.ExtractedFiles
|
|||
|
{
|
|||
|
public class ExtractedNativeFile : NativeFileStreamFactory, IExtractedFile
|
|||
|
{
|
|||
|
public bool CanMove { get; set; } = true;
|
|||
|
|
|||
|
public ExtractedNativeFile(AbsolutePath file, IPath path) : base(file, path)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public ExtractedNativeFile(AbsolutePath file) : base(file)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public async ValueTask Move(AbsolutePath newPath)
|
|||
|
{
|
|||
|
if (CanMove)
|
|||
|
await _file.MoveToAsync(newPath, overwrite: true);
|
|||
|
else
|
|||
|
await _file.CopyToAsync(newPath);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|