title: Get file extension in java
body: <p>I have a problem to get the extension of given file name. I receive 1 file URL.<br>
  It may be like      </p>
  
  <pre><code>/var/www.dir/file.tar.gz OR /var/www.dir/file.exe
  </code></pre>
  
  <p>Now I need to split the file extension (like .tar.gz OR .exe) from the given URL. The URL is given by the user dynamically. Any one please help me out, how to solve this problem</p>