mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Initial Commit
This commit is contained in:
35
NzbDrone.Core/Controllers/DiskController.cs
Normal file
35
NzbDrone.Core/Controllers/DiskController.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace NzbDrone.Core.Controllers
|
||||
{
|
||||
public class DiskController : IDiskController
|
||||
{
|
||||
#region IDiskController Members
|
||||
|
||||
public bool Exists(string path)
|
||||
{
|
||||
return Directory.Exists(path);
|
||||
}
|
||||
|
||||
public string[] GetDirectories(string path)
|
||||
{
|
||||
return Directory.GetDirectories(path);
|
||||
}
|
||||
|
||||
public String CreateDirectory(string path)
|
||||
{
|
||||
return Directory.CreateDirectory(path).FullName;
|
||||
}
|
||||
|
||||
|
||||
public string CleanPath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path)) throw new ArgumentException("Path can not be null or empty");
|
||||
|
||||
return path.ToLower().Trim('/', '\\', ' ');
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user