InputStream and Configuration

Discussion in 'Plugin Development' started by Moon_werewolf, Sep 20, 2011.

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

    Moon_werewolf

    I have a problem

    i have a easy little code where
    Code:
    InputStream stream = Mode.class.getResourceAsStream("modes.yml");
            Configuration config = new Configuration();
    the problem is this don't worlk new Configuration(stream); are the anyway i can do it with out extracting the file somewhere like System.getProperty("java.io.tmpdir")?

    i that file is important to my plugin but i don't want people messing with it and i could do my code so much smaller by having every mode in a file
     
  2. Offline

    DragonSoulSong

    Create an instance of a File object using the resource stream, perhaps? The constructor "Configuration(Stream)" is not defined, but "Configuration(File)" is.

    Edit: I'm not sure of an exact way to do this, or if it can be done, but it's an idea. *shrug*
     
Thread Status:
Not open for further replies.

Share This Page