commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgoes...@apache.org
Subject svn commit: r1023030 - in /commons/proper/email/trunk/src/java/org/apache/commons/mail: Email.java EmailConstants.java
Date Fri, 15 Oct 2010 17:33:08 GMT
Author: sgoeschl
Date: Fri Oct 15 17:33:07 2010
New Revision: 1023030

URL: http://svn.apache.org/viewvc?rev=1023030&view=rev
Log:
Moving the various constants of Email.java into EmailConstants.java

Added:
    commons/proper/email/trunk/src/java/org/apache/commons/mail/EmailConstants.java
Modified:
    commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java

Modified: commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java?rev=1023030&r1=1023029&r2=1023030&view=diff
==============================================================================
--- commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java (original)
+++ commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java Fri Oct 15 17:33:07
2010
@@ -60,87 +60,8 @@ import javax.naming.NamingException;
  * @version $Revision$ $Date$
  * @version $Id$
  */
-public abstract class Email
+public abstract class Email implements EmailConstants
 {
-    /** Constants used by Email classes. */
-
-    /** */
-    public static final String SENDER_EMAIL = "sender.email";
-    /** */
-    public static final String SENDER_NAME = "sender.name";
-    /** */
-    public static final String RECEIVER_EMAIL = "receiver.email";
-    /** */
-    public static final String RECEIVER_NAME = "receiver.name";
-    /** */
-    public static final String EMAIL_SUBJECT = "email.subject";
-    /** */
-    public static final String EMAIL_BODY = "email.body";
-    /** */
-    public static final String CONTENT_TYPE = "content.type";
-
-    /** */
-    public static final String MAIL_HOST = "mail.smtp.host";
-    /** */
-    public static final String MAIL_PORT = "mail.smtp.port";
-    /** */
-    public static final String MAIL_SMTP_FROM = "mail.smtp.from";
-    /** */
-    public static final String MAIL_SMTP_AUTH = "mail.smtp.auth";
-    /** */
-    public static final String MAIL_SMTP_USER = "mail.smtp.user";
-    /** */
-    public static final String MAIL_SMTP_PASSWORD = "mail.smtp.password";
-    /** */
-    public static final String MAIL_TRANSPORT_PROTOCOL =
-        "mail.transport.protocol";
-    /**
-     * @since 1.1
-     */
-    public static final String MAIL_TRANSPORT_TLS = "mail.smtp.starttls.enable";
-    /** */
-    public static final String MAIL_SMTP_SOCKET_FACTORY_FALLBACK = "mail.smtp.socketFactory.fallback";
-    /** */
-    public static final String MAIL_SMTP_SOCKET_FACTORY_CLASS = "mail.smtp.socketFactory.class";
-    /** */
-    public static final String MAIL_SMTP_SOCKET_FACTORY_PORT = "mail.smtp.socketFactory.port";
-
-
-    /**
-     * Socket connection timeout value in milliseconds. Default is infinite timeout.
-     * @since 1.2
-     */
-    public static final String MAIL_SMTP_CONNECTIONTIMEOUT = "mail.smtp.connectiontimeout";
-
-    /**
-     * Socket I/O timeout value in milliseconds. Default is infinite timeout.
-     * @since 1.2
-     */
-    public static final String MAIL_SMTP_TIMEOUT = "mail.smtp.timeout";
-
-
-    /** */
-    public static final String SMTP = "smtp";
-    /** */
-    public static final String TEXT_HTML = "text/html";
-    /** */
-    public static final String TEXT_PLAIN = "text/plain";
-    /** */
-    public static final String ATTACHMENTS = "attachments";
-    /** */
-    public static final String FILE_SERVER = "file.server";
-    /** */
-    public static final String MAIL_DEBUG = "mail.debug";
-
-    /** */
-    public static final String KOI8_R = "koi8-r";
-    /** */
-    public static final String ISO_8859_1 = "iso-8859-1";
-    /** */
-    public static final String US_ASCII = "us-ascii";
-    /** */
-    public static final String UTF_8 = "utf-8";
-
     /** The email message to send. */
     protected MimeMessage message;
 

Added: commons/proper/email/trunk/src/java/org/apache/commons/mail/EmailConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/java/org/apache/commons/mail/EmailConstants.java?rev=1023030&view=auto
==============================================================================
--- commons/proper/email/trunk/src/java/org/apache/commons/mail/EmailConstants.java (added)
+++ commons/proper/email/trunk/src/java/org/apache/commons/mail/EmailConstants.java Fri Oct
15 17:33:07 2010
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.mail;
+
+/**
+ * Constants used by Email classes
+ */
+public interface EmailConstants
+{
+    // Constants used by Email classes
+
+    /** the default socket timeout in milliseconds */
+    long DEFAULT_SOCKET_TIMEOUT  = 60000;
+
+    /** the default socket connection timeout value in milliseconds */
+    long DEFAULT_SOCKET_CONNECTION_TIMEOUT = 60000;
+   
+    String SENDER_EMAIL = "sender.email";
+    String SENDER_NAME = "sender.name";
+    String RECEIVER_EMAIL = "receiver.email";
+    String RECEIVER_NAME = "receiver.name";
+    String EMAIL_SUBJECT = "email.subject";
+    String EMAIL_BODY = "email.body";
+    String CONTENT_TYPE = "content.type";
+
+    String SMTP = "smtp";
+    String TEXT_HTML = "text/html";
+    String TEXT_PLAIN = "text/plain";
+    String ATTACHMENTS = "attachments";
+    String FILE_SERVER = "file.server";
+    String MAIL_DEBUG = "mail.debug";
+
+
+    String MAIL_HOST = "mail.smtp.host";
+    String MAIL_PORT = "mail.smtp.port";
+    String MAIL_SMTP_FROM = "mail.smtp.from";
+    String MAIL_SMTP_AUTH = "mail.smtp.auth";
+    String MAIL_SMTP_USER = "mail.smtp.user";
+    String MAIL_SMTP_PASSWORD = "mail.smtp.password";
+    String MAIL_TRANSPORT_PROTOCOL = "mail.transport.protocol";
+
+    // since 1.1
+    String MAIL_TRANSPORT_TLS = "mail.smtp.starttls.enable";
+    String MAIL_SMTP_SOCKET_FACTORY_FALLBACK = "mail.smtp.socketFactory.fallback";
+    String MAIL_SMTP_SOCKET_FACTORY_CLASS = "mail.smtp.socketFactory.class";
+    String MAIL_SMTP_SOCKET_FACTORY_PORT = "mail.smtp.socketFactory.port";
+
+    // since 1.2
+
+    /**
+     * Socket connection timeout value in milliseconds. Default is infinite timeout.
+     * @since 1.2
+     */
+     String MAIL_SMTP_CONNECTIONTIMEOUT = "mail.smtp.connectiontimeout";
+
+    /**
+     * Socket I/O timeout value in milliseconds. Default is infinite timeout.
+     * @since 1.2
+     */
+     String MAIL_SMTP_TIMEOUT = "mail.smtp.timeout";
+
+
+    // Charset constants
+    
+    String KOI8_R = "koi8-r";
+    String ISO_8859_1 = "iso-8859-1";
+    String US_ASCII = "us-ascii";
+    String UTF_8 = "utf-8";
+    
+}



Mime
View raw message