Revision: 7038
http://languagetool.svn.sourceforge.net/languagetool/?rev=7038&view=rev
Author: milek_pl
Date: 2012-05-23 08:13:15 +0000 (Wed, 23 May 2012)
Log Message:
-----------
remove duplicating the code for the config file location
Modified Paths:
--------------
trunk/JLanguageTool/src/java/org/languagetool/gui/Configuration.java
trunk/JLanguageTool/src/java/org/languagetool/server/LanguageToolHttpHandler.java
Modified: trunk/JLanguageTool/src/java/org/languagetool/gui/Configuration.java
===================================================================
--- trunk/JLanguageTool/src/java/org/languagetool/gui/Configuration.java
2012-05-23 07:45:04 UTC (rev 7037)
+++ trunk/JLanguageTool/src/java/org/languagetool/gui/Configuration.java
2012-05-23 08:13:15 UTC (rev 7038)
@@ -58,6 +58,15 @@
private boolean guiConfig;
private int serverPort = HTTPServer.DEFAULT_PORT;
+ /**
+ * Uses the configuration file from the default location.
+ *
+ * @throws IOException
+ */
+ public Configuration() throws IOException {
+ this(new File(System.getProperty("user.home")), CONFIG_FILE);
+ }
+
public Configuration(final File baseDir, final String filename)
throws IOException {
if (!baseDir.isDirectory()) {
Modified:
trunk/JLanguageTool/src/java/org/languagetool/server/LanguageToolHttpHandler.java
===================================================================
---
trunk/JLanguageTool/src/java/org/languagetool/server/LanguageToolHttpHandler.java
2012-05-23 07:45:04 UTC (rev 7037)
+++
trunk/JLanguageTool/src/java/org/languagetool/server/LanguageToolHttpHandler.java
2012-05-23 08:13:15 UTC (rev 7038)
@@ -11,7 +11,6 @@
import org.languagetool.tools.Tools;
import java.io.BufferedReader;
-import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
@@ -31,8 +30,6 @@
private final boolean verbose;
private final boolean internalServer;
- private static final String CONFIG_FILE = ".languagetool.cfg";
-
private final Configuration config;
LanguageToolHttpHandler(boolean verbose, Set<String> allowedIps,
@@ -40,7 +37,7 @@
this.verbose = verbose;
this.allowedIps = allowedIps;
this.internalServer = internal;
- config = new Configuration(new File(System.getProperty("user.home")),
CONFIG_FILE);
+ config = new Configuration();
}
@Override
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs