Find craftbukkit folder path

Discussion in 'Plugin Development' started by davidp027, Dec 25, 2014.

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

    davidp027

    I need to find the path of the craftbukkit folder(in a string) that will allow me to read file containing disk usage on my host [..]
    I tried
    Code:
    Main main; //Main class
    private File f = new File(main.getDataFolder() + "../");
    
    but it gives me errors
     
  2. Offline

    mythbusterma

  3. Offline

    davidp027

    On the host I use, there is a file named _disk-space.txt in the same folder as craftbukkit.jar etc. There is no place else than there to see how much disk space we have, not even on the control panel, and we ran out of space 2 days ago and it broke our map. I'm making a plugin to shutdown the server if there is less than 0.5% of disk space available.
     
  4. Offline

    API_Tutorials

    @davidp027
    Code:
    File f = new File("_disk-space.txt");
    
    // do something
     
  5. Offline

    davidp027

    it's not in the plugin folder, in the one containing the plugins folder
     
  6. Offline

    mythbusterma

    @davidp027

    You're definitely going to need a larger threshold than that....and you should probably get a less stupid host honestly.

    Anyway just create a new File from the path from File#getParent()
     
  7. Offline

    API_Tutorials

    @davidp027 that is the folder which craftbukkit.jar is in
     
Thread Status:
Not open for further replies.

Share This Page