SF.net SVN: tuotoo: [5] trunk/src/org/tuotoo/tor/Config.java
Status: Pre-Alpha
Brought to you by:
hanru
|
From: <ha...@us...> - 2007-11-24 08:28:42
|
Revision: 5
http://tuotoo.svn.sourceforge.net/tuotoo/?rev=5&view=rev
Author: hanru
Date: 2007-11-24 00:28:46 -0800 (Sat, 24 Nov 2007)
Log Message:
-----------
Set $HOME/tuotoo.conf as the default config file, also add a new getInstance() method to retrive non-default config file.
Modified Paths:
--------------
trunk/src/org/tuotoo/tor/Config.java
Modified: trunk/src/org/tuotoo/tor/Config.java
===================================================================
--- trunk/src/org/tuotoo/tor/Config.java 2007-11-22 12:29:19 UTC (rev 4)
+++ trunk/src/org/tuotoo/tor/Config.java 2007-11-24 08:28:46 UTC (rev 5)
@@ -48,6 +48,12 @@
return ms_instance;
}
+ public static Config getInstance(String conf) {
+ if (ms_instance == null)
+ ms_instance = new Config(conf);
+ return ms_instance;
+ }
+
public String getConfig(String key) {
return m_props.getProperty(key);
}
@@ -67,8 +73,6 @@
LogHolder.log(LogLevel.NOTICE, LogType.TOR, confFile
+ " not exists, creating an empty one.");
File f = new File(confFile);
- File pf = f.getParentFile();
- pf.mkdirs();
f.createNewFile();
} catch (Exception ex) {
ex.printStackTrace();
@@ -90,7 +94,6 @@
private static String getDefaultConfigLocation() {
return System.getProperty("user.home")
- + System.getProperty("file.separator") + ".tuotoo"
+ System.getProperty("file.separator") + "tuotoo.conf";
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|