title: java.nio.file.InvalidPathException with getPath
body: <p>I am using this code</p>
  
  <pre><code> String path =  getClass().getResource("Template.xls").getPath();
  </code></pre>
  
  <p>When I run it on my machine (windows), everything is good. I even did system.out.println on the get resource part and on the get path part and the results were:</p>
  
  <p>file:/C:/Eclipse/Netbeans/SoftwareCom/build/classes/assets/Template.xls    </p>
  
  <p>/C:/Eclipse/Netbeans/SoftwareCom/build/classes/assets/Template.xls </p>
  
  <p>However I am getting the following error reports from some users</p>
  
  <pre><code>java.nio.file.InvalidPathException: Illegal char &lt;:&gt; at index 4:
  file:\C:\Software%20Com\SoftwareCom.exe!\assets\Template.xls
  </code></pre>
  
  <p>Iam not sure whats happening or why would it work for some and not others</p>
  
  <p>Any pointers?</p>