Lucene.Net.Util.LuceneTestCase.GetDataFile C# (CSharp) Method

GetDataFile() protected method

Gets a resource from the classpath as File. this method should only be used, if a real file is needed. To get a stream, code should prefer Class#getResourceAsStream using {@code this.getClass()}.
protected GetDataFile ( string name ) : Stream
name string
return Stream
        protected Stream GetDataFile(string name)
        {
            try
            {
                var resourceLoader = new ClasspathResourceLoader(this.GetType(), "Lucene.Net");
                return resourceLoader.OpenResource(name);
            }
            catch (Exception e)
            {
                throw new IOException("Cannot find resource: " + name);
            }
        }