private Stream CreateStreamFromPath(String filePath, String basePath)
{
if (filePath == null)
throw new ArgumentNullException("filePath");
if (basePath == null)
throw new ArgumentNullException("basePath");
if (!Path.IsPathRooted(filePath) || !File.Exists(filePath))
{
// For a relative path, we use the basePath to
// resolve the full path
filePath = Path.Combine(basePath, filePath);
}
CheckFileExists(filePath);
this.filePath = Path.GetFileName(filePath);
this.basePath = Path.GetDirectoryName(filePath);
return File.OpenRead(filePath);
}