KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > mail > providers > ReadOnlyMessage


1 /*
2  * ReadOnlyMessage.java
3  * Copyright (C) 2003 Chris Burdess <dog@gnu.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * You also have permission to link it with the Sun Microsystems, Inc.
11  * JavaMail(tm) extension and run that combination.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  */

22
23 package gnu.mail.providers;
24
25 import java.io.InputStream JavaDoc;
26 import javax.mail.Flags JavaDoc;
27 import javax.mail.Folder JavaDoc;
28 import javax.mail.IllegalWriteException JavaDoc;
29 import javax.mail.Message JavaDoc;
30 import javax.mail.MessagingException JavaDoc;
31 import javax.mail.Multipart JavaDoc;
32 import javax.mail.internet.InternetHeaders JavaDoc;
33 import javax.mail.internet.MimeMessage JavaDoc;
34
35 /**
36  * Abstract read-only message.
37  * The superclass of mail provider messages that do not support message
38  * editing in-place.
39  *
40  * @author <a HREF='mailto:dog@gnu.org'>Chris Burdess</a>
41  * @version 1.0
42  */

43 public abstract class ReadOnlyMessage extends MimeMessage JavaDoc
44 {
45
46   protected ReadOnlyMessage(Folder JavaDoc folder, int msgnum)
47     throws MessagingException JavaDoc
48   {
49     super(folder, msgnum);
50   }
51
52   protected ReadOnlyMessage(Folder JavaDoc folder, InputStream JavaDoc in, int msgnum)
53     throws MessagingException JavaDoc
54   {
55     super(folder, in, msgnum);
56   }
57
58   protected ReadOnlyMessage(Folder JavaDoc folder, InternetHeaders JavaDoc headers,
59       byte[] content, int msgnum)
60     throws MessagingException JavaDoc
61   {
62     super(folder, msgnum);
63   }
64
65   // -- content --
66

67   public void setContent(Object JavaDoc o, String JavaDoc type)
68     throws MessagingException JavaDoc
69   {
70     throw new IllegalWriteException JavaDoc();
71   }
72
73   public void setContent(Multipart JavaDoc mp)
74     throws MessagingException JavaDoc
75   {
76     throw new IllegalWriteException JavaDoc();
77   }
78
79   // -- headers --
80

81   public void setHeader(String JavaDoc name, String JavaDoc value)
82     throws MessagingException JavaDoc
83   {
84     throw new IllegalWriteException JavaDoc();
85   }
86
87   public void addHeader(String JavaDoc name, String JavaDoc value)
88     throws MessagingException JavaDoc
89   {
90     throw new IllegalWriteException JavaDoc();
91   }
92
93   public void removeHeader(String JavaDoc name)
94     throws MessagingException JavaDoc
95   {
96     throw new IllegalWriteException JavaDoc();
97   }
98
99   public void addHeaderLine(String JavaDoc line)
100     throws MessagingException JavaDoc
101   {
102     throw new IllegalWriteException JavaDoc();
103   }
104
105   // -- flags --
106

107   public void setFlags(Flags JavaDoc flag, boolean set)
108     throws MessagingException JavaDoc
109   {
110     throw new IllegalWriteException JavaDoc();
111   }
112
113   // -- general --
114

115   public void saveChanges()
116     throws MessagingException JavaDoc
117   {
118   }
119
120 }
121
Popular Tags