title: How to get absolute path of directory of a file?
body: <p>How can I get an absolute path of a directory containing a file specified:</p>
  
  <pre><code>// current dir is "/home/me/dev"
  File file = new File("./target/test.txt");
  assert absolute(file).equals("/home/me/dev/target");
  </code></pre>
  
  <p>It's Java 6.</p>