Added FolderWritable to DiskProvider to centralize the check.

This commit is contained in:
Taloth Saldono
2015-01-21 20:59:03 +01:00
parent 104d35299b
commit 11803afc39
10 changed files with 106 additions and 49 deletions

View File

@@ -31,13 +31,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
return new HealthCheck(GetType(), HealthCheckResult.Error, "Drone factory folder does not exist");
}
try
{
var testPath = Path.Combine(droneFactoryFolder, "drone_test.txt");
_diskProvider.WriteAllText(testPath, DateTime.Now.ToString());
_diskProvider.DeleteFile(testPath);
}
catch (Exception)
if (!_diskProvider.FolderWritable(droneFactoryFolder))
{
return new HealthCheck(GetType(), HealthCheckResult.Error, "Unable to write to drone factory folder");
}