package cz.kamma.llamarunner;

import java.io.File;

/**
 * Manages configuration file locations in the user's home directory.
 */
public class ConfigLocation {

    private final File appDir;
    private final File configPropertiesFile;
    private final File profilesJsonFile;

    public ConfigLocation() {
        appDir = new File(".");
        configPropertiesFile = new File(appDir, "config.properties");
        profilesJsonFile = new File(appDir, "profiles.json");
    }

    /**
     * Ensures the application directory exists.
     */
    public void ensureDirectoryExists() {
        if (!appDir.exists()) {
            appDir.mkdirs();
        }
    }

    public File getAppDir() {
        return appDir;
    }

    public File getConfigPropertiesFile() {
        return configPropertiesFile;
    }

    public File getProfilesJsonFile() {
        return profilesJsonFile;
    }

    public String getConfigPropertiesFilePath() {
        return configPropertiesFile.getAbsolutePath();
    }

    public String getProfilesJsonFilePath() {
        return profilesJsonFile.getAbsolutePath();
    }
}
