Advertisement
Tom2565

Untitled

Oct 30th, 2017
19,526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. public static File file = new File("plugins//TestOrdner//Test.yml");
  2. public static File path = new File("plugins//TestOrdner");
  3. public static YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
  4.  
  5. public void Config1() {
  6. Filemanager.dateiErstellen(path, file);
  7. cfg.options().copyDefaults(true);
  8. cfg.addDefault("USER", "");
  9. cfg.addDefault("PASS", "");
  10. cfg.addDefault("HOST", "");
  11. cfg.addDefault("DB", "");
  12. Filemanager.dateiSpeichern(file, cfg);
  13. }
  14.  
  15.  
  16.  
  17. static String host;
  18. static String db;
  19. static String user;
  20. static String pass;
  21.  
  22.  
  23. // Um die Werte wieder auszulesen:
  24.  
  25.  
  26. host = cfg.getString("HOST");
  27. db = cfg.getString("DB");
  28. user = cfg.getString("USER");
  29. pass = cfg.getString("PASS");
  30.  
  31. // Du kannst dir das dann umbauen wie du willst, mit dem add default, zb p.getName usw
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement