KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > mail > FolderClosedException


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21
22 /*
23  * @(#)FolderClosedException.java 1.6 05/08/29
24  *
25  * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
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. <p>
33  *
34  * Following the exception, the Folder is reset to the "closed" state.
35  * All 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. <p>
38  *
39  * The getMessage() method returns more detailed information about the
40  * error that caused this exception. <p>
41  *
42  * @author John Mani
43  */

44
45 public class FolderClosedException extends MessagingException JavaDoc {
46     transient private Folder JavaDoc folder;
47
48     private static final long serialVersionUID = 1687879213433302315L;
49     
50     /**
51      * Constructor
52      * @param folder the Folder
53      */

54     public FolderClosedException(Folder JavaDoc folder) {
55     this(folder, null);
56     }
57
58     /**
59      * Constructor
60      * @param folder the Folder
61      * @param message the detailed error message
62      */

63     public FolderClosedException(Folder JavaDoc folder, String JavaDoc message) {
64     super(message);
65     this.folder = folder;
66     }
67
68     /**
69      * Returns the dead Folder object
70      */

71     public Folder JavaDoc getFolder() {
72     return folder;
73     }
74 }
75
Popular Tags