Recursively create directory
If you don't mind relying on a 3rd party API, the Apache Commons IO package does this directly for you. Take a look at FileUtils.ForceMkdir.
The Apache license is commercial software development friendly, i.e. it doesn't require you to distribute your source code the way the GPL does. (Which may be a good or a bad thing, depending on your point of view).
You can simply use the mkdirs() method of java.io.File
class.
Example:
new File("C:\\Directory1\\Directory2").mkdirs();