throwExceptionFactory.CreateForParamValidation(param.Name,"The string is not long enough. Must be at least '{0}' but was '{1}' characters long.".Inject(minLength,length));
throwExceptionFactory.CreateForParamValidation(param.Name,string.Format("value [{0}] is not a valid relative path. relative paths must end with \\",param.Value));
throwExceptionFactory.CreateForParamValidation(param.Name,string.Format("value [{0}] is not a valid relative path. relative paths can not start with \\",param.Value));
throwExceptionFactory.CreateForParamValidation(param.Name,string.Format("value [{0}] is not a valid *nix path. paths must start with \\",param.Value));
}
}
else
{
if(windowsInvalidPathRegex.IsMatch(param.Value))
{
throwExceptionFactory.CreateForParamValidation(param.Name,string.Format("value [{0}] is not a valid Windows path. It contains invalid characters",param.Value));
}
//Network path
if(param.Value.StartsWith("\\"))returnparam;
if(!windowsPathRegex.IsMatch(param.Value))
{
throwExceptionFactory.CreateForParamValidation(param.Name,string.Format("value [{0}] is not a valid Windows path. paths must be a full path eg. C:\\Windows",param.Value));