1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-10 04:52:42 +01:00
Radarr/NzbDrone.Core/Providers/DiskProvider.cs
Keivan c8a8fb4d62 Fixed notification issues
Added basic support for file scan
Major redactor of ReportTitle/File parsing
Updated Ninject/Ninject.MVC
Removed dependency from Microsoft.Web.Administration
reactored Episode repository structure
2010-10-20 18:49:23 -07:00

39 lines
978 B
C#

using System;
using System.IO;
namespace NzbDrone.Core.Providers
{
public class DiskProvider : IDiskProvider
{
#region IDiskProvider Members
public bool Exists(string path)
{
return Directory.Exists(path);
}
public string[] GetDirectories(string path)
{
return Directory.GetDirectories(path);
}
public string[] GetFiles(string path, string pattern, SearchOption searchOption)
{
return Directory.GetFiles(path, pattern, searchOption);
}
public String CreateDirectory(string path)
{
return Directory.CreateDirectory(path).FullName;
}
#endregion
public static string CleanPath(string path)
{
if (string.IsNullOrEmpty(path))
throw new ArgumentException("Path can not be null or empty");
return path.ToLower().Trim('/', '\\', ' ');
}
}
}