You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by se...@apache.org on 2002/02/27 06:05:53 UTC
cvs commit: jakarta-james/src/java/org/apache/james BaseConnectionHandler.java James.java
serge 02/02/26 21:05:53
Modified: src/java/org/apache/james BaseConnectionHandler.java
James.java
Log:
Patch from Eung-ju Park <co...@apache.org> to use getValueAsBoolean to make code more readable.
Revision Changes Path
1.7 +4 -9 jakarta-james/src/java/org/apache/james/BaseConnectionHandler.java
Index: BaseConnectionHandler.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/BaseConnectionHandler.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- BaseConnectionHandler.java 18 Jan 2002 02:48:35 -0000 1.6
+++ BaseConnectionHandler.java 27 Feb 2002 05:05:53 -0000 1.7
@@ -36,18 +36,13 @@
} catch (UnknownHostException ue) {
hostName = "localhost";
}
-
+
Configuration helloConf = configuration.getChild("helloName");
- String autodetect = null;
- try {
- autodetect = helloConf.getAttribute("autodetect");
- } catch(ConfigurationException ex) {
- autodetect = "TRUE";
- }
- if ("TRUE".equals(autodetect))
+ boolean autodetect = helloConf.getAttributeAsBoolean("autodetect", true);
+ if (autodetect)
helloName = hostName;
else
helloName = helloConf.getValue("localhost");
getLogger().info("Hello Name is: " + helloName);
}
-}
+}
\ No newline at end of file
1.19 +6 -18 jakarta-james/src/java/org/apache/james/James.java
Index: James.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/James.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- James.java 4 Feb 2002 15:34:11 -0000 1.18
+++ James.java 27 Feb 2002 05:05:53 -0000 1.19
@@ -55,8 +55,8 @@
* @author <a href="mailto:charles@benett1.demon.co.uk">Charles Benett</a>
*
- * This is $Revision: 1.18 $
- * Committed on $Date: 2002/02/04 15:34:11 $ by: $Author: danny $
+ * This is $Revision: 1.19 $
+ * Committed on $Date: 2002/02/27 05:05:53 $ by: $Author: serge $
*/
public class James
@@ -144,7 +144,7 @@
// Get the domains and hosts served by this instance
serverNames = new Vector();
Configuration serverConf = conf.getChild("servernames");
- if (serverConf.getAttribute("autodetect").equals("TRUE") && (!hostName.equals("localhost"))) {
+ if (serverConf.getAttributeAsBoolean("autodetect") && (!hostName.equals("localhost"))) {
serverNames.add(hostName.toLowerCase());
}
@@ -169,21 +169,9 @@
context.put( Constants.POSTMASTER, postmaster );
Configuration userNamesConf = conf.getChild("usernames");
- if (userNamesConf.getAttribute("ignoreCase").equals("TRUE")) {
- ignoreCase = true;
- } else {
- ignoreCase = false;
- }
- if (userNamesConf.getAttribute("enableAliases").equals("TRUE")) {
- enableAliases = true;
- } else {
- enableAliases = false;
- }
- if (userNamesConf.getAttribute("enableForwarding").equals("TRUE")) {
- enableForwarding = true;
- } else {
- enableForwarding = false;
- }
+ ignoreCase = userNamesConf.getAttributeAsBoolean("ignoreCase", false);
+ enableAliases = userNamesConf.getAttributeAsBoolean("enableAliases", false);
+ enableForwarding = userNamesConf.getAttributeAsBoolean("enableForwarding", false);
//Get localusers
try {
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>