from typing import Dict


class MappingFileUtil:

    @staticmethod
    def create_empty_file(file_path: str):
        with open(file_path, "w") as file:
            pass  # Do nothing, just create the file



    @staticmethod
    def write_dictionary_to_file(file_path: str, dictionary: Dict[str, str]):
        with open(file_path, 'w') as file:
            for key, value in dictionary.items():
                file.write(f"{key}={value}\n")

    @staticmethod
    def file_to_dictionary(file_path) -> Dict[str, str]:
        result_dict = {}
        with open(file_path, 'r') as file:
            for line in file:
                # Split the line into key and value based on the colon separator
                key, value = line.split('=', 1)
                # Strip leading/trailing whitespace from key and value
                key = key.strip()
                value = value.strip()
                # Add to dictionary
                result_dict[key] = value
        return result_dict
