Source Code Cross Referenced for Mailer.java in  » Build » ANT » org » apache » tools » ant » taskdefs » email » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant.taskdefs.email 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         *
017:         */
018:        package org.apache.tools.ant.taskdefs.email;
019:
020:        import java.util.Vector;
021:        import org.apache.tools.ant.BuildException;
022:        import org.apache.tools.ant.Task;
023:        import org.apache.tools.ant.util.DateUtils;
024:
025:        /**
026:         * Base class for the various emailing implementations.
027:         *
028:         * @since Ant 1.5
029:         */
030:        public abstract class Mailer {
031:            // CheckStyle:VisibilityModifier OFF - bc
032:            protected String host = null;
033:            protected int port = -1;
034:            protected String user = null;
035:            protected String password = null;
036:            // CheckStyle:MemberNameCheck OFF - bc
037:            protected boolean SSL = false;
038:            // CheckStyle:MemberNameCheck ON
039:            protected Message message;
040:            protected EmailAddress from;
041:            protected Vector replyToList = null;
042:            protected Vector toList = null;
043:            protected Vector ccList = null;
044:            protected Vector bccList = null;
045:            protected Vector files = null;
046:            protected String subject = null;
047:            protected Task task;
048:            protected boolean includeFileNames = false;
049:            protected Vector headers = null;
050:
051:            // CheckStyle:VisibilityModifier ON
052:
053:            /**
054:             * Set the mail server.
055:             *
056:             * @param host the mail server name.
057:             */
058:            public void setHost(String host) {
059:                this .host = host;
060:            }
061:
062:            /**
063:             * Set the smtp port.
064:             *
065:             * @param port the SMTP port.
066:             */
067:            public void setPort(int port) {
068:                this .port = port;
069:            }
070:
071:            /**
072:             * Set the user for smtp auth.
073:             *
074:             * @param user the username.
075:             * @since Ant 1.6
076:             */
077:            public void setUser(String user) {
078:                this .user = user;
079:            }
080:
081:            /**
082:             * Set the password for smtp auth.
083:             *
084:             * @param password the authentication password.
085:             * @since Ant 1.6
086:             */
087:            public void setPassword(String password) {
088:                this .password = password;
089:            }
090:
091:            /**
092:             * Set whether to send the mail through SSL.
093:             *
094:             * @param ssl if true use SSL transport.
095:             * @since Ant 1.6
096:             */
097:            public void setSSL(boolean ssl) {
098:                this .SSL = ssl;
099:            }
100:
101:            /**
102:             * Set the message.
103:             *
104:             * @param m the message content.
105:             */
106:            public void setMessage(Message m) {
107:                this .message = m;
108:            }
109:
110:            /**
111:             * Set the address to send from.
112:             *
113:             * @param from the sender.
114:             */
115:            public void setFrom(EmailAddress from) {
116:                this .from = from;
117:            }
118:
119:            /**
120:             * Set the replyto addresses.
121:             *
122:             * @param list a vector of reployTo addresses.
123:             * @since Ant 1.6
124:             */
125:            public void setReplyToList(Vector list) {
126:                this .replyToList = list;
127:            }
128:
129:            /**
130:             * Set the to addresses.
131:             *
132:             * @param list a vector of recipient addresses.
133:             */
134:            public void setToList(Vector list) {
135:                this .toList = list;
136:            }
137:
138:            /**
139:             * Set the cc addresses.
140:             *
141:             * @param list a vector of cc addresses.
142:             */
143:            public void setCcList(Vector list) {
144:                this .ccList = list;
145:            }
146:
147:            /**
148:             * Set the bcc addresses.
149:             *
150:             * @param list a vector of the bcc addresses.
151:             */
152:            public void setBccList(Vector list) {
153:                this .bccList = list;
154:            }
155:
156:            /**
157:             * Set the files to attach.
158:             *
159:             * @param files list of files to attach to the email.
160:             */
161:            public void setFiles(Vector files) {
162:                this .files = files;
163:            }
164:
165:            /**
166:             * Set the subject.
167:             *
168:             * @param subject the subject line.
169:             */
170:            public void setSubject(String subject) {
171:                this .subject = subject;
172:            }
173:
174:            /**
175:             * Set the owning task.
176:             *
177:             * @param task the owning task instance.
178:             */
179:            public void setTask(Task task) {
180:                this .task = task;
181:            }
182:
183:            /**
184:             * Indicate whether filenames should be listed in the body.
185:             *
186:             * @param b if true list attached file names in the body content.
187:             */
188:            public void setIncludeFileNames(boolean b) {
189:                this .includeFileNames = b;
190:            }
191:
192:            /**
193:             * Set the generic headers to add to the email.
194:             * @param v a Vector presumed to contain Header objects.
195:             * @since Ant 1.7
196:             */
197:            public void setHeaders(Vector v) {
198:                this .headers = v;
199:            }
200:
201:            /**
202:             * Send the email.
203:             *
204:             * @throws BuildException if the email can't be sent.
205:             */
206:            public abstract void send() throws BuildException;
207:
208:            /**
209:             * Return the current Date in a format suitable for a SMTP date
210:             * header.
211:             *
212:             * @return the current date in SMTP suitable format.
213:             *
214:             * @since Ant 1.5
215:             */
216:            protected final String getDate() {
217:                return DateUtils.getDateForHeader();
218:            }
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.