title: Java URL separator or File.separator
body: <p>I have checked similar qestions where they suggested to use <code>String</code> as a parameter. But that is what I do.</p>
  
  <p>My Code:</p>
  
  <pre><code> uri.lastIndexOf(File.separator)
  </code></pre>
  
  <p>Where <code>uri</code> is: <code>file:/C:/Users/oto@increase.dk/workspace/Maersk_Line_GaTracking/bin/</code></p>
  
  <p>Maybe that is because Windows uses back slashes as file separator. But why then, when I retrieve the URI, I am getting forward slashes?</p>
  
  <pre><code>String uri = DataRetrieval.class.getProtectionDomain().getCodeSource().getLocation() + "";
  </code></pre>