0

Есть файл properties нужно все его значения перевести в Map, как грамотно это сделать?

1 ответ 1

2
Properties properties = new Properties();
properties.load(new FileInputStream("some.properties"));

Map<String, String> map = new HashMap<>();

for (String name : properties.stringPropertyNames()) {
    map.put(name, properties.getProperty(name));
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.