Skip to content
This repository was archived by the owner on Jan 19, 2018. It is now read-only.

Commit 46c7a06

Browse files
Standardise on JSON
Also fix the copyrights
1 parent 2d69cb6 commit 46c7a06

File tree

5 files changed

+9
-45
lines changed

5 files changed

+9
-45
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ bin/
66
target/
77

88
# Configuration
9-
uc_pircbotx.json
10-
uc_pircbotx.properties
9+
uc_pircbotx.json

src/main/java/uk/co/unitycoders/pircbotx/Bot.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © 2012 Bruce Cowan <bruce@bcowan.me.uk>
3-
* Copyright © 2012 Joseph Walton-Rivers <webpigeon@unitycoders.co.uk>
2+
* Copyright © 2012-2013 Bruce Cowan <bruce@bcowan.me.uk>
3+
* Copyright © 2012-2013 Joseph Walton-Rivers <webpigeon@unitycoders.co.uk>
44
*
55
* This file is part of uc_PircBotX.
66
*
@@ -42,10 +42,10 @@ public class Bot
4242
{
4343
public static void main(String[] args) throws Exception
4444
{
45-
// Bot Configuration
46-
Configuration config = ConfigurationManager.loadJsonConfig();
45+
// Bot Configuration
46+
Configuration config = ConfigurationManager.loadConfig();
4747

48-
CommandProcessor processor = new CommandProcessor(config.trigger);
48+
CommandProcessor processor = new CommandProcessor(config.trigger);
4949

5050
ProfileManager profiles = new ProfileManager(DBConnection.getProfileModel());
5151
DateTimeCommand dtCmd = new DateTimeCommand();

src/main/java/uk/co/unitycoders/pircbotx/Configuration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* Copyright © 2012 Bruce Cowan <bruce@bcowan.me.uk>
3-
* Copyright © 2012 Joseph Walton-Rivers <webpigeon@unitycoders.co.uk>
2+
* Copyright © 2013 Joseph Walton-Rivers <webpigeon@unitycoders.co.uk>
43
*
54
* This file is part of uc_PircBotX.
65
*

src/main/java/uk/co/unitycoders/pircbotx/ConfigurationManager.java

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © 2012 Bruce Cowan <bruce@bcowan.me.uk>
3-
* Copyright © 2012 Joseph Walton-Rivers <webpigeon@unitycoders.co.uk>
2+
* Copyright © 2013 Joseph Walton-Rivers <webpigeon@unitycoders.co.uk>
3+
* Copyright © 2013 Bruce Cowan <bruce@bcowan.me.uk>
44
*
55
* This file is part of uc_PircBotX.
66
*
@@ -23,7 +23,6 @@
2323
import java.io.FileReader;
2424
import java.io.IOException;
2525
import java.io.Reader;
26-
import java.util.Properties;
2726

2827
/**
2928
* Static Utility class to deal with configuration files.
@@ -48,26 +47,6 @@ private static Reader getFileReader(String file) throws IOException {
4847
}
4948

5049
public static Configuration loadConfig() throws IOException {
51-
Properties properties = new Properties();
52-
properties.load(getFileReader(CONF_FILE_NAME));
53-
54-
Configuration config = new Configuration();
55-
56-
// Get connection infomation
57-
config.host = properties.getProperty("host", DEFAULT_IRC_HOST);
58-
config.port = Integer.parseInt(properties.getProperty("port", DEFAULT_PORT));
59-
config.nick = properties.getProperty("nick", DEFAULT_BOT_NAME);
60-
config.ssl = Boolean.parseBoolean(properties.getProperty("ssl", DEFAULT_SSL));
61-
config.trigger = properties.getProperty("trigger", DEFAULT_TRIGGER).charAt(0);
62-
63-
//work out what channels to connect to
64-
String channelStr = properties.getProperty("channels",DEFAULT_CHANS);
65-
config.channels = channelStr.split(",");
66-
67-
return config;
68-
}
69-
70-
public static Configuration loadJsonConfig() throws IOException {
7150
Gson gson = new Gson();
7251
return gson.fromJson(getFileReader(JSON_FILE_NAME), Configuration.class);
7352
}

src/main/resources/uc_pircbotx.properties.example

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)