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 ).
where you wouldn't have to type the Path and then file in separate lines ( of code ) ?
File file = new File("Library\\test.txt");
if (file.getParentFile().mkdir()) {
file.createNewFile();
} else {
throw new IOException("Failed to create directory " + file.getParent());
}
Basically looking for the equivalent approach to "getParentFile().mkdir()" off the Path ( and file ) entered in Java 7 NIO.
Thx