Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1.     private static File directory = new File("plugins/Careers");
  2.     private static File configfile = new File(directory + "/config.yml");
  3.     private static Configuration config;
  4.    
  5.     public static void Initialize() throws Exception
  6.     {
  7.         if(!directory.exists()) directory.mkdir();
  8.         if(!configfile.exists())
  9.         {
  10.             GenerateConfig();
  11.         }
  12.  
  13.         config = new Configuration(configfile);
  14.         config.load();
  15.     }
  16.  
  17.        
  18.     private static void GenerateConfig() throws Exception
  19.     {  
  20.         configfile.createnewfile();
  21.         config.setProperty("herp","derp");
  22.         config.save()
  23.  
  24.  
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement