serge 02/02/26 21:06:47
Modified: src/java/org/apache/james/smtpserver SMTPServer.java
Log:
Patch from Eung-ju Park <[EMAIL PROTECTED]> to use getValueAsBoolean to make code
more readable.
Revision Changes Path
1.3 +11 -9
jakarta-james/src/java/org/apache/james/smtpserver/SMTPServer.java
Index: SMTPServer.java
===================================================================
RCS file:
/home/cvs/jakarta-james/src/java/org/apache/james/smtpserver/SMTPServer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SMTPServer.java 18 Jan 2002 02:48:37 -0000 1.2
+++ SMTPServer.java 27 Feb 2002 05:06:47 -0000 1.3
@@ -23,7 +23,7 @@
* @author Matthew Pangaro <[EMAIL PROTECTED]>
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
*/
-public class SMTPServer
+public class SMTPServer
extends AbstractService {
protected ConnectionHandlerFactory createFactory()
@@ -36,22 +36,24 @@
m_port = configuration.getChild( "port" ).getValueAsInteger( 25 );
- try
- {
+ try
+ {
final String bindAddress = configuration.getChild( "bind" ).getValue(
null );
if( null != bindAddress )
{
- m_bindTo = InetAddress.getByName( bindAddress );
+ m_bindTo = InetAddress.getByName( bindAddress );
}
}
- catch( final UnknownHostException unhe )
+ catch( final UnknownHostException unhe )
{
throw new ConfigurationException( "Malformed bind parameter", unhe );
}
- final String useTLS = configuration.getChild("useTLS").getValue( "" );
- if( useTLS.equals( "TRUE" ) ) m_serverSocketType = "ssl";
-
+ final boolean useTLS = configuration.getChild("useTLS").getValueAsBoolean(
false );
+ if( useTLS ) {
+ m_serverSocketType = "ssl";
+ }
+
super.configure( configuration.getChild( "handler" ) );
}
@@ -62,4 +64,4 @@
System.out.println("Started SMTP Server "+m_connectionName);
}
}
-
+
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>