title: URI scheme is not "file". Unable to read file from classpath
body: <p>I have Java webapp and I am trying to read a file from classpth. </p>
  
  <pre><code> if (fileName == null){
          fileName = Thread.currentThread().getContextClassLoader().getResource("config.properties");
      }
  objFile = new File(fileName.toURI());
  </code></pre>
  
  <p>I have config.properties in my classpath. WEB-INF/classes. When I inspect locally it gives: <code>fileName.toURI()</code>, it gives me <code>file:/D:/dev/Tomcat_6_0/webapps/testApp/WEB-INF/classes/config.properties</code>. And works fine.</p>
  
  <p>Issue is on production linux server I am getting this path there <code>vfsfile:/export/home/u/bin/jboss-5.1.0.BE/server/default/deploy/testApp.war/WEB-INF/classes/config.properties</code>.</p>
  
  <p>And I am getting following exception.</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: URI scheme is not "file"
      at java.io.File.&lt;init&gt;(File.java:366)
      at com.utils.ConfigLoader.loadConfigFilePath(ConfigLoader.java:87)
  </code></pre>
  
  <p>What is the workaround for handeling vfs? </p>