Castle.Core.Resource.FileResource.CreateStreamFromPath C# (CSharp) Method

CreateStreamFromPath() private method

private CreateStreamFromPath ( String filePath, String basePath ) : Stream
filePath String
basePath String
return Stream
		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);
		}