Add FileInfo utility functions to DiskProvider

This commit is contained in:
ta264
2020-10-07 21:06:03 +01:00
committed by Qstick
parent 024e4df99c
commit f917d0e9bc
3 changed files with 14 additions and 6 deletions
+9 -2
View File
@@ -505,13 +505,20 @@ namespace NzbDrone.Common.Disk
return di.GetDirectories().ToList();
}
public List<FileInfo> GetFileInfos(string path)
public FileInfo GetFileInfo(string path)
{
Ensure.That(path, () => path).IsValidPath();
return new FileInfo(path);
}
public List<FileInfo> GetFileInfos(string path, SearchOption searchOption = SearchOption.TopDirectoryOnly)
{
Ensure.That(path, () => path).IsValidPath();
var di = new DirectoryInfo(path);
return di.GetFiles().ToList();
return di.GetFiles("*", searchOption).ToList();
}
public void RemoveEmptySubfolders(string path)