KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > mail > FolderNotFoundException


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  * @(#)FolderNotFoundException.java 1.7 05/08/29
24  *
25  * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
26  */

27
28 package javax.mail;
29
30 import java.lang.*;
31
32 /**
33  * This exception is thrown by Folder methods, when those
34  * methods are invoked on a non existent folder.
35  *
36  * @author John Mani
37  */

38
39 public class FolderNotFoundException extends MessagingException JavaDoc {
40     transient private Folder JavaDoc folder;
41
42     private static final long serialVersionUID = 472612108891249403L;
43
44     /**
45      * Constructs a MessagingException with no detail message.
46      */

47     public FolderNotFoundException() {
48     super();
49     }
50
51     /**
52      * Constructs a MessagingException with the specified folder.
53      * @param folder the Folder
54      * @since JavaMail 1.2
55      */

56     public FolderNotFoundException(Folder JavaDoc folder) {
57     super();
58         this.folder = folder;
59     }
60
61     /**
62      * Constructs a MessagingException with the specified folder and
63      * the specified detail message.
64      * @param folder the Folder
65      * @param s the detail message
66      * @since JavaMail 1.2
67      */

68     public FolderNotFoundException(Folder JavaDoc folder, String JavaDoc s) {
69     super(s);
70     this.folder = folder;
71     }
72
73     /**
74      * Constructs a MessagingException with the specified detail message
75      * and the specified folder.
76      * @param s the detail message
77      * @param folder the Folder
78      */

79     public FolderNotFoundException(String JavaDoc s, Folder JavaDoc folder) {
80     super(s);
81     this.folder = folder;
82     }
83
84     /**
85      * Returns the offending Folder object.
86      * @return the Folder object. Note that the returned value can be
87      * <code>null</code>.
88      */

89     public Folder JavaDoc getFolder() {
90     return folder;
91     }
92 }
93
Popular Tags