title: Change file name and its extension before output it Java
body: <p>Lets say I've got a file in D: which has a filepath as:</p>
  
  <pre><code>        D:\work\2012\018\08\2b558ad8-4ea4-4cb9-b645-6c9a9919ba01
  </code></pre>
  
  <p>at the moment the name of this file is not meaningful. It doesn't have a format. I would like to have the ability to create file object from the above filepath in Java and change its name and format before writing it into bytes. The new path could be as following: </p>
  
  <pre><code>       D:\work\2012\018\08\mywork.pdf
  </code></pre>
  
  <p>After the changes have been made, I should still be able to gain access to the original file per normal.</p>
  
  <p>I already know the type of the file and its name so there won't be a problem getting those details.</p>