initial oogynize check in _ this actually used to work!

This commit is contained in:
2016-02-14 21:16:31 -08:00
parent b183af5d55
commit 532ea133bc
337 changed files with 30692 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Foo.AddIn.Common
{
public static class Validate
{
/// <summary>
/// Validate ArtifactLocation * We could later do much more work here *
/// </summary>
/// <returns></returns>
public static bool IsValidArtifactLocation(string strArtifactLocation, ref FuncRetVal retVal)
{
// All URLs should contain that character (Files aren't allowed to contain it)
bool bIsUrl = strArtifactLocation.Contains('/');
if (String.IsNullOrEmpty(strArtifactLocation))
{
retVal.Type = FuncRetValEnum.ParameterInvalid;
return false;
}
else if (!bIsUrl && !File.Exists(strArtifactLocation))
{
// Check File existence (if it doesn't return false)
return false;
}
else
{
return true;
}
}
}
}