]> jfr.im git - irc/Ozafy/borknet_p10_irc_services.git/blame - core/ConfLoader.java
First commit
[irc/Ozafy/borknet_p10_irc_services.git] / core / ConfLoader.java
CommitLineData
431b229b
LP
1/**
2#
3# BorkNet Services Core
4#
5
6#
7# Copyright (C) 2004 Ozafy - ozafy@borknet.org - http://www.borknet.org
8#
9# This program is free software; you can redistribute it and/or
10# modify it under the terms of the GNU General Public License
11# as published by the Free Software Foundation; either version 2
12# of the License, or (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22#
23*/
24package borknet_services.core;
25import java.io.*;
26import java.util.*;
27import borknet_services.core.*;
28
29/**
30 * Class to load configuration files.
31 * @author Ozafy - ozafy@borknet.org - http://www.borknet.org
32 */
33public class ConfLoader
34{
35 /** The properties extracted from the configuration file */
36 Properties dataSrc = new Properties();
37 private Core C;
38 private String file;
39
40 /**
41 * Constructs a Loader
42 * @param debug If we're running in debug.
43 */
44 public ConfLoader(Core C)
45 {
46 this.C = C;
47 file = "bot.conf";
48 }
49
50 /**
51 * Constructs a Loader
52 * @param debug If we're running in debug.
53 */
54 public ConfLoader(Core C, String file)
55 {
56 this.C = C;
57 this.file = file;
58 }
59
60 /**
61 * loads the configuration file
62 */
63 public void load() throws Exception
64 {
65 FileInputStream fis = new FileInputStream(file);
66 dataSrc.load(fis);
67 }
68
69 /**
70 * Constructs a IRCClient.
71 * @return all the variables gotten from the configuration file
72 */
73 public Properties getVars()
74 {
75 return dataSrc;
76 }
77}