package util;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**Класс для работы с настройками приложения
 * включает:
 * -папка синхронизации SINCHRONIZATION_PATH
 * -..
 * @author Cloudraid Dev Team (cloudraid.stnetix.com)
 */

public class AppSettings {
    private static final String PROPERTIES_FILE_NAME = "main.ini";
    public static Properties properties = new Properties();
    public static Map<String, String> prop = new HashMap<>();

    public static void loadProperties(){
        try {
            properties.load(new FileInputStream(AppSettings.class.getResource("../"+PROPERTIES_FILE_NAME).getFile()));
        } catch (IOException e) {
            e.printStackTrace();
        }
        prop.put("SINCHRONIZATION_PATH", properties.getProperty("SINCHRONIZATION_PATH"));
    }
    public static void saveProperties(){
        /**
         * TODO реализовать сохранение настроек. если не вызывать метод, настройки не сохраняются
         */
    }
    public static void setProperty(String key, String val){
        prop.put(key,val);
    }




}

@@ -12,29 +12,8 @@
 l;%0A%0A
-import java.io.File;%0A
 impo
@@ -72,62 +72,8 @@
 on;%0A
-import java.nio.file.Path;%0Aimport java.nio.file.Paths;
 %0Aimp
@@ -203,16 +203,26 @@
 %D0%B2%D0%BA%D0%BB%D1%8E%D1%87%D0%B0%D0%B5%D1%82
+ %D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B8
 :%0A * -%D0%BF%D0%B0
@@ -353,16 +353,86 @@
 tings %7B%0A
+    public enum PROPERTIES_KEYS %7B%0A        SINCHRONIZATION_PATH%0A    %7D%0A%0A
     priv
@@ -572,22 +572,31 @@
 tic Map%3C
-String
+PROPERTIES_KEYS
 , String
@@ -890,17 +890,32 @@
 rop.put(
-%22
+PROPERTIES_KEYS.
 SINCHRON
@@ -926,17 +926,16 @@
 ION_PATH
-%22
 , proper
@@ -951,17 +951,32 @@
 roperty(
-%22
+PROPERTIES_KEYS.
 SINCHRON
@@ -987,17 +987,23 @@
 ION_PATH
-%22
+.name()
 ));%0A    
@@ -1208,22 +1208,31 @@
 roperty(
-String
+PROPERTIES_KEYS
  key, St
@@ -1279,10 +1279,12 @@
   %7D%0A%0A%0A%0A%0A
+%0A%0A
 %7D%0A

update AppSettings class