added method to create all directories for a given path