You load them with a pharser I been looking into differnt looading recently and my friend help me
You can figure it outCode:package com.ultimate.rs.xml; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; /** * * Loads Servers settigs * * @author UltimateG (The base for XML Loading) * */ public class Settings { Properties props; String dir = "./data/xml/"; String file = "settings.xml"; public Settings() { props = new Properties(); try { FileInputStream in = new FileInputStream(dir + file); if (file.endsWith("xml")) { props.loadFromXML(in); } else { props.load(in); } } catch (IOException e) { e.printStackTrace(); } } /** * Gets the name of the Server * * @return The Server's Name */ public String getServerName() { String serverName = props.getProperty("ServerName"); return serverName; } /** * Gets the Server's Port * * @return The Server's Port */ public int getServerPort() { int port = Integer.parseInt(props.getProperty("Port")); return port; } /** * Gets the Build * * @return The Server's Build */ public String getServerBuild() { String build = props.getProperty("Build"); return build; } }
I just need to know how to make it seperate out so I can load more than 1 thing if you get wat a mean