Saving a folder from jar to plugin dir

Discussion in 'Plugin Development' started by brord, Sep 30, 2013.

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

    brord

    Well the title says it all.
    I have a couple of folders inside my jar, which contain more folders or files.
    I need to save em to the /plugins/name/ folder.
    Ofcourse i could go with a JarFile object, and load everything, but the saveResource should be able to do it right?

    Example:
    plugin.jar\maps\map.yml

    I tried to jsut type plugin.saveResource("maps", true);
    But that gave me a not foudn error :/

    Anyone knwos how to do this with the bukkit API?
     
  2. Offline

    Gopaintman

    Code:java
    1. File name = new File(this.plugin.getDataFolder(), "nameofdir");
    2. if (!name.exists()) {
    3. name.mkdir();
    4. }
     
  3. Offline

    brord

    no i mean, its INSIDE the jar ;)
    i want it from the jar to the folder

    Uhm so what i want is to load the folder maps and weapons FROM tje jar to the plugin directory.
    Including all the sub-directories and files

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
Thread Status:
Not open for further replies.

Share This Page