diff --git a/apps/BOB/src/net/i2p/BOB/BOB.java b/apps/BOB/src/net/i2p/BOB/BOB.java index 022172341090a73cf4ae05a376438aa041cf7e09..ca2d6f878a67c2a5e871c26df871176e1370f680 100644 --- a/apps/BOB/src/net/i2p/BOB/BOB.java +++ b/apps/BOB/src/net/i2p/BOB/BOB.java @@ -35,9 +35,73 @@ import net.i2p.client.I2PClient; import net.i2p.client.streaming.RetransmissionTimer; import net.i2p.util.Log; import net.i2p.util.SimpleTimer; - /** - * + * <span style="font-size:8px;font-family:courier;color:#EEEEEE;background-color:#000000"> + * ################################################################################<br> + * ############################.#..........#..#..........##########################<br> + * #######################......................................###################<br> + * ####################...........................#.......#........################<br> + * #################..................##...................#.........##############<br> + * ###############................###...####.....#..###.....#.........#############<br> + * #############...........###..#..###...#####...###.##........#.......############<br> + * ###########................#......##...#####...##..##.......#..#........########<br> + * ##########.........................#....##.##..#...##.....................######<br> + * #########...................................#....#.........................#####<br> + * ########.........................................#...............#..........####<br> + * ########.........................................#..........#######..........###<br> + * #######.................................................############..........##<br> + * #######..........................................####################.........##<br> + * #######............####################......########################.........##<br> + * ######.............###############################################.##.........##<br> + * ######............################################################..##........##<br> + * ######............################################################..##........##<br> + * ######.............##############################################..##.........##<br> + * ######............##############################################...##..........#<br> + * ######............#..###########################################...##..........#<br> + * ######.............#############################################....#..........#<br> + * #######...........###############################################..##.........##<br> + * #######...........#####.#.#.#.########################.....#.####...##........##<br> + * ######............#..............##################.................##.........#<br> + * ######................####.........###############........#####......##........#<br> + * ######..............####..#.........############.......##.#.######...##.......##<br> + * ######.................#.####.........########...........##....###...##.......##<br> + * #######....#....###...................#######...............#...###..##.......##<br> + * #######.........###..###.....###.......######.##.#####.........####..##.......##<br> + * #######.....#...##############.........############......###########.###......##<br> + * #######....##...##########.......##...##############......#.############.....###<br> + * ########....#..########......######...##################################....####<br> + * ########....##.####################...##################################....####<br> + * ########..#.##..###################..##################################..#..####<br> + * ##########..###..#################...##################################...#.####<br> + * #########....##...##############....########..#####.################.##..#.#####<br> + * ############.##....##########.......#########.###.......###########..#.#########<br> + * ###############.....#######...#.......########.....##.....######.....###########<br> + * ###############......###....##..........##.......######....#.........#.#########<br> + * ##############............##..................##########..............##########<br> + * ##############..............................##########..#.............##########<br> + * ###############.......##..................#####..............####....###########<br> + * ###############.......#####.......#.............####.....#######.....###########<br> + * ################...#...####......##################.....########....############<br> + * ################...##..#####.........####.##.....#....##########....############<br> + * ##################..##..####...........#####.#....############.....#############<br> + * ##################......#####.................################....##############<br> + * ###################.....####..........##########..###########....###############<br> + * ####################..#..#..........................########.....###############<br> + * #####################.##.......###.................########....#################<br> + * ######################.........#.......#.##.###############....#################<br> + * #############.#######...............#####################....###################<br> + * ###..#.....##...####..........#.....####################....####################<br> + * ####......##........................##################....######################<br> + * #.##...###..............###.........###############......#######################<br> + * #...###..##............######...........................########################<br> + * ##.......###..........##########....#...#...........############################<br> + * ##.........##.......############################################################<br> + * ###........##.....##############################################################<br> + * ####.............###############################################################<br> + * ######.........#################################################################<br> + * #########....###################################################################<br> + * ################################################################################<br> + * </span> * BOB, main command socket listener, launches the command parser engine. * * @author sponge @@ -89,16 +153,19 @@ public class BOB { // This is here just to ensure there is no interference with our threadgroups. SimpleTimer Y = RetransmissionTimer.getInstance(); i = Y.hashCode(); - - try { - props.load(new FileInputStream(configLocation)); - } catch(FileNotFoundException fnfe) { - warn("Unable to load up the BOB config file " + configLocation + ", Using defaults."); - warn(fnfe.toString()); - save = true; - } catch(IOException ioe) { - warn("IOException on BOB config file " + configLocation + ", using defaults."); - warn(ioe.toString()); + { + try { + FileInputStream fi = new FileInputStream(configLocation); + props.load(fi); + fi.close(); + } catch(FileNotFoundException fnfe) { + warn("Unable to load up the BOB config file " + configLocation + ", Using defaults."); + warn(fnfe.toString()); + save = true; + } catch(IOException ioe) { + warn("IOException on BOB config file " + configLocation + ", using defaults."); + warn(ioe.toString()); + } } // Global router and client API configurations that are missing are set to defaults here. if(!props.containsKey(I2PClient.PROP_TCP_HOST)) { @@ -131,7 +198,9 @@ public class BOB { if(save) { try { warn("Writing new defaults file " + configLocation); - props.store(new FileOutputStream(configLocation), configLocation); + FileOutputStream fo = new FileOutputStream(configLocation); + props.store(fo, configLocation); + fo.close(); } catch(IOException ioe) { warn("IOException on BOB config file " + configLocation + ", " + ioe); } diff --git a/apps/BOB/src/net/i2p/BOB/doCMDS.java b/apps/BOB/src/net/i2p/BOB/doCMDS.java index 2fb363b189386e401789225386295f6919f26bdb..e6c7b6fd78e66f16da648806a8f10bbcd4d40300 100644 --- a/apps/BOB/src/net/i2p/BOB/doCMDS.java +++ b/apps/BOB/src/net/i2p/BOB/doCMDS.java @@ -151,7 +151,7 @@ public class doCMDS implements Runnable { */ doCMDS(Socket server, Properties props, nickname database, Log _log) { this.server = server; - this.props = props; + this.props = new Properties(props); this.database = database; this._log = _log; }