title: NIO getParentFile().mkdir()
body: <p>Is there a way to create a file and directory in one shot
  as in below... (Using Java 7 and NIO... Paths and Files static methods ).</p>
  
  <p>where you wouldn't have to type the Path and then file in separate lines ( of code ) ?</p>
  
  <pre><code>File file = new File("Library\\test.txt");
  if (file.getParentFile().mkdir()) {
      file.createNewFile();
  } else {
      throw new IOException("Failed to create directory " + file.getParent());
  }
  </code></pre>
  
  <p>Basically looking for the equivalent approach to "getParentFile().mkdir()" off the Path ( and file ) entered in Java 7 NIO.</p>
  
  <p>Thx</p>