Phonegap – Create nested directories

By default PhoneGap File API creates only one directory at a time and the developer has to write the additional code in case nested directory structure is required. Below is an example of a small utility method which creates the nested directory structure based on the given path.