public virtual string SaveFile(string contents, string fileName)
{
if(string.IsNullOrEmpty(contents))
{
throw new ArgumentNullException("contents");
}
contents = TextUtils.ReplaceWorkflowNewLinesWithEnvironmentNewLines(contents);
fileName = InvalidFileNameChars.Aggregate(fileName, (current, c) => current.Replace(c.ToString(CultureInfo.InvariantCulture), ""));
var path = Path.Combine(_tempPath, fileName);
File.AppendAllText(path, contents);
string linkUri = string.Format(EnvironmentVariables.WebServerUri + "/Services/{0}?DebugItemFilePath={1}", "FetchDebugItemFileService", path);
return linkUri;
}