2013-08-31 20:31:58 +00:00
|
|
|
|
using FluentValidation.Validators;
|
|
|
|
|
using NzbDrone.Common;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Api.Validation
|
|
|
|
|
{
|
|
|
|
|
public class PathValidator : PropertyValidator
|
|
|
|
|
{
|
|
|
|
|
public PathValidator()
|
|
|
|
|
: base("Invalid Path")
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool IsValid(PropertyValidatorContext context)
|
|
|
|
|
{
|
2013-08-31 20:46:59 +00:00
|
|
|
|
if (context.PropertyValue == null) return false;
|
2013-08-31 20:31:58 +00:00
|
|
|
|
return context.PropertyValue.ToString().IsPathValid();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|