Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. public class Prop {
  2.  
  3. public static final String EMAIL = "mail";
  4. public static final String PASS = "password";
  5. public static final String RECIPENTS = "recipents";
  6. public static final String FIO = "fio";
  7. public static final String USER = "user";
  8. public static final String EMAIL_JIRA = "mailJira";
  9. public static final String PASS_JIRA = "passwordJira";
  10.  
  11. private Properties properties;
  12.  
  13. private Reader reader;
  14.  
  15. public Prop() {
  16.  
  17. properties = new Properties();
  18.  
  19. try {
  20. reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("config.properties"), "utf-8"));
  21. } catch (Exception e) {
  22. e.printStackTrace();
  23. }
  24.  
  25. try {
  26. properties.load(reader);
  27. } catch (Exception e) {
  28. e.printStackTrace();
  29. }
  30. }
  31.  
  32.  
  33. public String get(String key) {
  34. return properties.getProperty(key);
  35. }
  36.  
  37. public void set(String key, String value) {
  38. properties.setProperty(key, value);
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement