Example #1
0
 /// <summary>
 /// Gets a resource from the classpath as <seealso cref="File"/>. this method should only
 /// be used, if a real file is needed. To get a stream, code should prefer
 /// <seealso cref="Class#getResourceAsStream"/> using {@code this.getClass()}.
 /// </summary>
 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);
     }
 }