Skip to content

Package: FolderClosedException

FolderClosedException

nameinstructionbranchcomplexitylinemethod
FolderClosedException(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%
FolderClosedException(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%
FolderClosedException(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, 2023 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 a method is invoked on a Messaging object
21: * and the Folder that owns that object has died due to some reason. <p>
22: *
23: * Following the exception, the Folder is reset to the "closed" state.
24: * All messaging objects owned by the Folder should be considered invalid.
25: * The Folder can be reopened using the "open" method to reestablish the
26: * lost connection. <p>
27: *
28: * The getMessage() method returns more detailed information about the
29: * error that caused this exception.
30: *
31: * @author John Mani
32: */
33:
34: public class FolderClosedException extends MessagingException {
35: transient private Folder folder;
36:
37: private static final long serialVersionUID = 1687879213433302315L;
38:
39: /**
40: * Constructs a FolderClosedException.
41: *
42: * @param folder The Folder
43: */
44: public FolderClosedException(Folder folder) {
45: this(folder, null);
46: }
47:
48: /**
49: * Constructs a FolderClosedException with the specified
50: * detail message.
51: *
52: * @param folder The Folder
53: * @param message The detailed error message
54: */
55: public FolderClosedException(Folder folder, String message) {
56: super(message);
57: this.folder = folder;
58: }
59:
60: /**
61: * Constructs a FolderClosedException with the specified
62: * detail message and embedded exception. The exception is chained
63: * to this exception.
64: *
65: * @param folder The Folder
66: * @param message The detailed error message
67: * @param e The embedded exception
68: * @since JavaMail 1.5
69: */
70: public FolderClosedException(Folder folder, String message, Exception e) {
71: super(message, e);
72: this.folder = folder;
73: }
74:
75: /**
76: * Returns the dead Folder object
77: *
78: * @return the dead Folder object
79: */
80: public Folder getFolder() {
81: return folder;
82: }
83: }