You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/src/NzbDrone.Core/Validation/FolderValidator.cs

25 lines
586 B

using FluentValidation.Validators;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.Validation
{
public class FolderValidator : PropertyValidator
{
public FolderValidator()
: base("Invalid Path")
{
}
protected override bool IsValid(PropertyValidatorContext context)
{
if (context.PropertyValue == null)
{
return false;
}
return context.PropertyValue.ToString().IsPathValid(PathValidationType.CurrentOs);
}
}
}