title: How to write elegant code using File.mkdirs() in java?
body: <p>I need a directory to save files but I am not sure whether it exists.<br>
  So I need to check if it exists first, and create it if necessary. </p>
  
  <pre><code>File saveDir = new File("/tmp/appname/savedir/");
  if(!saveDir.exists()){
      saveDir.mkdirs(); 
  }
  </code></pre>
  
  <p>As above, there is a question.<br>
  Method "saveDir.exists()" returns a boolean value which indicates if the file path exists. </p>
  
  <p>Of course, I could write some redundant and ugly code to work.</p>
  
  <p>Is there a way to write some elegant code to achieve this goal?</p>