title: How to get current path?
body: <p>I'm trying to get current path of system.  I use this statement for this purpose  :</p>
  
  <pre><code>String currentPath = System.getProperty("user.dir");
  </code></pre>
  
  <p>When I run this statement For Example from <code>E:\</code>.  I get <code>E:\</code></p>
  
  <p>but when I run from desktop I get <code>C:\users\zavarghadim\desktop</code>.  The last slash <code>(\)</code> missed.  Why this happen?  In both type I need last slash <code>c:\users\zavargadim\desktop\</code></p>
  
  <p>Can anyone help me to solve this problem?</p>