Results 1 to 2 of 2
  1. #1
    bolgerboy99 is offline Member
    Join Date
    Jul 2014
    Rep Power

    Default Reading from a separate config file

    I am trying to create a bukkit plugin. I need to be able to read from a separate config file but do not know how.

    I am trying to use a JSON parser to read from a file but I only need a specific line of the file. Would this work?:

    JSONParser parser = new JSONParser();
    Object obj = parser.parse(new FileReader("/plugins/easyRace/config.yml"));
    JSONObject jsonObject = (JSONObject) obj;
    String Races = jsonObject.get(var "Races:");

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Rep Power

    Default Re: Reading from a separate config file

    That's no question to ask in a forum. Create a simple command line Java application, add that code into it, try it out. If it blows up, read the error, research the error, fix it. Then when you have it working, transfer the code to your bukkit plugin.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. config.ini file?
    By JavaJimme in forum JDBC
    Replies: 2
    Last Post: 05-09-2013, 04:47 PM
  2. location of config file
    By shivam0101 in forum New To Java
    Replies: 1
    Last Post: 09-01-2012, 09:02 PM
  3. structs config file
    By gani in forum Struts
    Replies: 2
    Last Post: 07-11-2012, 09:41 AM
  4. loggig - config file
    By jlmp in forum NetBeans
    Replies: 3
    Last Post: 03-29-2011, 10:56 AM
  5. reading values from config file
    By sathish_2111 in forum Enterprise JavaBeans (EJB)
    Replies: 3
    Last Post: 08-10-2007, 03:09 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts