Skip to content

Package: ReadOnlyFolderException

ReadOnlyFolderException

nameinstructionbranchcomplexitylinemethod
ReadOnlyFolderException(Folder)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
ReadOnlyFolderException(Folder, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
ReadOnlyFolderException(Folder, String, Exception)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getFolder()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package jakarta.mail;
18:
19: /**
20: * This exception is thrown when an attempt is made to open a folder
21: * read-write access when the folder is marked read-only. <p>
22: *
23: * The getMessage() method returns more detailed information about the
24: * error that caused this exception. <p>
25: *
26: * @author Jim Glennon
27: */
28:
29: public class ReadOnlyFolderException extends MessagingException {
30: transient private Folder folder;
31:
32: private static final long serialVersionUID = 5711829372799039325L;
33:
34: /**
35: * Constructs a ReadOnlyFolderException with the specified
36: * folder and no detail message.
37: *
38: * @param folder        the Folder
39: * @since                 JavaMail 1.2
40: */
41: public ReadOnlyFolderException(Folder folder) {
42:         this(folder, null);
43: }
44:
45: /**
46: * Constructs a ReadOnlyFolderException with the specified
47: * detail message.
48: *
49: * @param folder         The Folder
50: * @param message        The detailed error message
51: * @since                 JavaMail 1.2
52: */
53: public ReadOnlyFolderException(Folder folder, String message) {
54:         super(message);
55:         this.folder = folder;
56: }
57:
58: /**
59: * Constructs a ReadOnlyFolderException with the specified
60: * detail message and embedded exception. The exception is chained
61: * to this exception.
62: *
63: * @param folder         The Folder
64: * @param message        The detailed error message
65: * @param e                The embedded exception
66: * @since                JavaMail 1.5
67: */
68: public ReadOnlyFolderException(Folder folder, String message, Exception e) {
69:         super(message, e);
70:         this.folder = folder;
71: }
72:
73: /**
74: * Returns the Folder object.
75: *
76: * @return        the Folder
77: * @since                 JavaMail 1.2
78: */
79: public Folder getFolder() {
80:         return folder;
81: }
82: }