1 |
/* |
2 |
* FolderClosedException.java |
3 |
* Copyright (C) 2002 The Free Software Foundation |
4 |
* |
5 |
* This file is part of GNU JavaMail, a library. |
6 |
* |
7 |
* GNU JavaMail is free software; you can redistribute it and/or modify |
8 |
* it under the terms of the GNU General Public License as published by |
9 |
* the Free Software Foundation; either version 2 of the License, or |
10 |
* (at your option) any later version. |
11 |
* |
12 |
* GNU JavaMail is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with this library; if not, write to the Free Software |
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 |
* |
21 |
* As a special exception, if you link this library with other files to |
22 |
* produce an executable, this library does not by itself cause the |
23 |
* resulting executable to be covered by the GNU General Public License. |
24 |
* This exception does not however invalidate any other reasons why the |
25 |
* executable file might be covered by the GNU General Public License. |
26 |
*/ |
27 |
|
28 |
package javax.mail; |
29 |
|
30 |
/** |
31 |
* This exception is thrown when a method is invoked on a Messaging object |
32 |
* and the Folder that owns that object has died due to some reason. |
33 |
* <p> |
34 |
* Following the exception, the Folder is reset to the "closed" state. All |
35 |
* messaging objects owned by the Folder should be considered invalid. |
36 |
* The Folder can be reopened using the "open" method to reestablish the |
37 |
* lost connection. |
38 |
* <p> |
39 |
* The <code>getMessage()</code> method returns more detailed information |
40 |
* about the error that caused this exception. |
41 |
* |
42 |
* @author <a href="mailto:dog@gnu.org">Chris Burdess</a> |
43 |
*/ |
44 |
public class FolderClosedException |
45 |
extends MessagingException |
46 |
{ |
47 |
|
48 |
/* |
49 |
* The Folder |
50 |
*/ |
51 |
private Folder folder; |
52 |
|
53 |
public FolderClosedException(Folder folder) |
54 |
{ |
55 |
this(folder, null); |
56 |
} |
57 |
|
58 |
public FolderClosedException(Folder folder, String message) |
59 |
{ |
60 |
super(message); |
61 |
this.folder = folder; |
62 |
} |
63 |
|
64 |
/** |
65 |
* Returns the dead Folder object |
66 |
*/ |
67 |
public Folder getFolder() |
68 |
{ |
69 |
return folder; |
70 |
} |
71 |
|
72 |
} |