In case the file doesn't exists, this method is called from the directory class which checks if the file can be created in the directory