title: Java - Clean file path
body: <p>I want to clean the path I use in my App. The path can be modified and sometimes I got something like that:</p>
  
  <pre><code>C:/users/Username/Desktop/\..\..\..\Windows\Web\..\..\Program Files\..\Program Files\..\Python27\
  </code></pre>
  
  <p>But I would like to have something like:</p>
  
  <pre><code>C:\Python27\
  </code></pre>
  
  <p>That's an example!</p>
  
  <p>How can I clean the path to get only the necessary part?</p>
  
  <p>Thanks.</p>