PropertiesLoader.java 459 B

12345678910111213141516171819
  1. package de.jplag.utils;
  2. import java.io.IOException;
  3. import java.io.InputStream;
  4. import java.util.Properties;
  5. public class PropertiesLoader {
  6. public static Properties loadProps(String resourceName) {
  7. Properties props = new Properties();
  8. try (InputStream in = PropertiesLoader.class.getClassLoader()
  9. .getResourceAsStream(resourceName);) {
  10. props.load(in);
  11. in.close();
  12. } catch (IOException e) {
  13. e.printStackTrace();
  14. }
  15. return props;
  16. }
  17. }