static internal string StaticGetStreamNameForConfigSource(string streamName, string configSource) {
//
if (!Path.IsPathRooted(streamName)) {
throw ExceptionUtil.ParameterInvalid("streamName");
}
// get the path part of the original stream
streamName = Path.GetFullPath(streamName);
string dirStream = UrlPath.GetDirectoryOrRootName(streamName);
// combine with the new config source
string result = Path.Combine(dirStream, configSource);
result = Path.GetFullPath(result);
// ensure the result is in or under the directory of the original source
string dirResult = UrlPath.GetDirectoryOrRootName(result);
if (!UrlPath.IsEqualOrSubdirectory(dirStream, dirResult)) {
throw new ArgumentException(SR.GetString(SR.Config_source_not_under_config_dir, configSource));
}
return result;
}