title: Build relative path between two file path
body: <p>I would like to compare two paths in the same workspace folder, and get the relative path between them :</p>
  
  <pre><code>String firPath = "C:/toto/tata/test1/test2/img/1.jpg" // test example
  String secPath = "C:/toto/tata/test1/img/1.jpg" // test example
  </code></pre>
  
  <p>And return firstPath relative path from secondPath </p>
  
  <pre><code>example = "../../img/"
  </code></pre>
  
  <p>I found lots of example in different language (python, .net, c++ ...) :</p>
  
  <p><a href="https://stackoverflow.com/questions/275689/how-to-get-relative-path-from-absolute-path">How to get relative path from absolute path</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17263112/compare-path-and-get-relative-path-between-two-files-with-javascript">compare path and get relative path between two files with javascript</a></p>
  
  <p>...but no solution with <strong>java</strong>.</p>
  
  <p>Most of the time, what is use are libraries methods, and I was wondering if java had the same methods I could use.</p>
  
  <p>Thank you for your help.</p>