KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > email > util > MailAttachment


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.email.util;
19
20
21 import java.net.URL JavaDoc;
22
23 /**
24  * <p>This class models the email attachment.</p>
25  *
26  * <p>Copyright 2000 Sapient </p>
27  * @since carbon 1.0
28  * @author Nitin Gulati, May 2002
29  * @version $Revision: 1.7 $($Author: dvoet $ / $Date: 2003/05/05 21:21:30 $)
30  */

31 public class MailAttachment {
32
33     /**
34      * <p>The name of the attachment. E.g "logo".</p>
35      */

36     private String JavaDoc name;
37
38
39     /**
40      * <p>The attachment description. E.g "logo.gif".</p>
41      */

42     private String JavaDoc description;
43
44
45     /**
46      * <p>The relative path of the attachment on the machine.
47      * E.g "config/email/gifs/logo.gif".</p>
48      */

49     private String JavaDoc path;
50
51
52     /**
53      * <p>The <code>java.net.URL</code> of the attachment.
54      * E.g <code>URL url = new URL
55      * ("file", "localhost", "config/email/gifs/logo.gif");</code></p>
56      */

57     private URL JavaDoc url;
58
59
60     /**
61      * <p>This constructor constructs a Mail attachment object using the
62      * name, description and path of the attachment. </p>
63      *
64      * @param name The name of the attachment.
65      * @param description The attachment description.
66      * @param path The relative path of the attachment.
67      */

68     public MailAttachment(String JavaDoc name, String JavaDoc description,
69                            String JavaDoc path) {
70         this.name = name;
71         this.description = description;
72         this.path = path;
73     }
74
75
76     /**
77      * <p>This constructor constructs a Mail attachment object using the
78      * name, description and URL of the attachment. </p>
79      *
80      * @param name The name of the attachment.
81      * @param description The attachment description.
82      * @param url The <code>URL</code> of the attachment.
83      */

84     public MailAttachment(String JavaDoc name, String JavaDoc description,
85                            URL JavaDoc url) {
86         this.name = name;
87         this.description = description;
88         this.url = url;
89     }
90
91
92     /**
93      * Getter for name.
94      *
95      * @return String
96      */

97     public String JavaDoc getName() {
98         return name;
99     }
100
101
102     /**
103      * Getter for description.
104      *
105      * @return String
106      */

107     public String JavaDoc getDescription() {
108         return description;
109     }
110
111
112     /**
113      * Getter for path.
114      *
115      * @return String
116      */

117     public String JavaDoc getPath() {
118         return path;
119     }
120
121
122     /**
123      * Getter for URL.
124      *
125      * @return URL
126      */

127     public URL JavaDoc getURL() {
128         return url;
129     }
130 }
131
Popular Tags