[Urgent] Create a folder in my plugin's folder

Discussion in 'Plugin Development' started by Cheesepro, Nov 4, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Cheesepro

    I need a way to create a folder in my plugin's folder so the config file can be organized and not be all over the place. if you know how to do it, Please help me... Thanks!
     
  2. Offline

    teej107

  3. Offline

    Dudemister1999

    Cheesepro
    Code:java
    1. File subFolder = new File(getDataFolder(), "test");
    2. subFolder.mkdir();
     
  4. Offline

    Cheesepro

    teej107 Dudemister1999 Thanks but do you guys also know how to put the config files in the folder?
    Here is what I have right now in the onEnable():
    Code:java
    1. warploc wloc = warploc.getInstance();
    2. wloc.setup(this);
    3. if (!new File(getDataFolder(), "warploc.yml").exists()) {
    4. saveDefaultConfig();
    5. }
    6.  
    7. spawnloc sloc = spawnloc.getInstance();
    8. sloc.setup(this);
    9. if (!new File(getDataFolder(), "spawnloc.yml").exists()) {
    10. saveDefaultConfig();
    11. }
     
  5. Offline

    teej107

  6. Offline

    Cheesepro

    teej107 Thanks :D let me take a look on that
     
  7. Offline

    Dudemister1999

    teej107 Didn't know that mkdirs() made a difference, thanks for pointing that out. :p
     
    teej107 likes this.
Thread Status:
Not open for further replies.

Share This Page