company.gonapps.loghut.dao.SettingDao.java Source code

Java tutorial

Introduction

Here is the source code for company.gonapps.loghut.dao.SettingDao.java

Source

/**
* LogHut is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LogHut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LogHut.  If not, see <http://www.gnu.org/licenses/>.
**/

package company.gonapps.loghut.dao;

import java.io.IOException;
import java.util.Properties;

import org.springframework.stereotype.Repository;

@Repository
public class SettingDao {

    private Properties properties;

    private SettingDao() throws IOException {
        properties = new Properties();
        properties.load(this.getClass().getResourceAsStream("/settings.properties"));
    }

    public String getSetting(String key) {
        return properties.getProperty(key);
    }
}