new method created for create the parent directories from a given file.