2013-08-31 23:31:58 +03:00
|
|
|
using FluentValidation.Validators;
|
2014-12-02 08:26:25 +02:00
|
|
|
using NzbDrone.Common.Extensions;
|
2013-08-31 23:31:58 +03:00
|
|
|
|
2014-02-16 12:56:12 +03:00
|
|
|
namespace NzbDrone.Core.Validation
|
2013-08-31 23:31:58 +03:00
|
|
|
{
|
2014-02-16 12:56:12 +03:00
|
|
|
public class FolderValidator : PropertyValidator
|
2013-08-31 23:31:58 +03:00
|
|
|
{
|
2014-02-16 12:56:12 +03:00
|
|
|
public FolderValidator()
|
2013-08-31 23:31:58 +03:00
|
|
|
: base("Invalid Path")
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override bool IsValid(PropertyValidatorContext context)
|
|
|
|
{
|
2013-08-31 23:46:59 +03:00
|
|
|
if (context.PropertyValue == null) return false;
|
2013-08-31 23:31:58 +03:00
|
|
|
return context.PropertyValue.ToString().IsPathValid();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|