fixed a bunch of things. added basic support for file scanning. logs are now avilable in the UI

This commit is contained in:
Keivan
2010-10-24 00:46:58 -07:00
parent c8a8fb4d62
commit fa0af257ff
48 changed files with 914 additions and 208 deletions

View File

@@ -7,11 +7,16 @@ namespace NzbDrone.Core.Providers
{
#region IDiskProvider Members
public bool Exists(string path)
public bool FolderExists(string path)
{
return Directory.Exists(path);
}
public bool FileExists(string path)
{
return File.Exists(path);
}
public string[] GetDirectories(string path)
{
return Directory.GetDirectories(path);
@@ -22,18 +27,16 @@ namespace NzbDrone.Core.Providers
return Directory.GetFiles(path, pattern, searchOption);
}
public long GetSize(string path)
{
return new FileInfo(path).Length;
}
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('/', '\\', ' ');
}
}
}