package de.jottyfan.camporganizer.module.staticpages;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Service;

import de.jottyfan.camporganizer.Main;

/**
 *
 * @author jotty
 *
 */
@Service
public class StaticPagesService {

	@Autowired
	private ResourceLoader resourceLoader;

	public Properties getStockDescription() {
		Resource resource = resourceLoader.getResource(
        "classpath:/static/images/stock.properties"
    );
		Properties properties = new Properties();
		try {
			properties.load(resource.getInputStream());
		} catch (IOException e) {
			Main.LOGGER.error(e.getMessage());
		}
		return properties;
	}

}
