* replaced mkdir() calls with mkdirs() to take care of creation of parent directories
* check for result of mkdirs() and throw RuntimeException in case of failures