KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > mail > ReadOnlyFolderException


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  * @(#)ReadOnlyFolderException.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 an attempt is made to open a folder
32  * read-write access when the folder is marked read-only. <p>
33  *
34  * The getMessage() method returns more detailed information about the
35  * error that caused this exception. <p>
36  *
37  * @author Jim Glennon
38  */

39
40 public class ReadOnlyFolderException extends MessagingException JavaDoc {
41     transient private Folder JavaDoc folder;
42
43     private static final long serialVersionUID = 5711829372799039325L;
44     
45     /**
46      * Constructs a MessagingException with the specified folder.
47      * @param folder the Folder
48      * @since JavaMail 1.2
49      */

50     public ReadOnlyFolderException(Folder JavaDoc folder) {
51     this(folder, null);
52     }
53
54     /**
55      * Constructs a MessagingException with the specified folder and
56      * the specified detail message.
57      * @param folder the Folder
58      * @param message the detailed error message
59      * @since JavaMail 1.2
60      */

61     public ReadOnlyFolderException(Folder JavaDoc folder, String JavaDoc message) {
62     super(message);
63     this.folder = folder;
64     }
65
66     /**
67      * Returns the dead Folder object.
68      * @since JavaMail 1.2
69      */

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