1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.mail;
  6. /**
  7. * This exception is thrown when a method is invoked on a Messaging object
  8. * and the Folder that owns that object has died due to some reason. <p>
  9. *
  10. * Following the exception, the Folder is reset to the "closed" state.
  11. * All messaging objects owned by the Folder should be considered invalid.
  12. * The Folder can be reopened using the "open" method to reestablish the
  13. * lost connection. <p>
  14. *
  15. * The getMessage() method returns more detailed information about the
  16. * error that caused this exception. <p>
  17. *
  18. * @author John Mani
  19. */
  20. public class FolderClosedException extends MessagingException {
  21. transient private Folder folder;
  22. /**
  23. * Constructor
  24. * @param folder the Folder
  25. */
  26. public FolderClosedException(Folder folder) {
  27. this(folder, null);
  28. }
  29. /**
  30. * Constructor
  31. * @param folder the Folder
  32. * @param message the detailed error message
  33. */
  34. public FolderClosedException(Folder folder, String message) {
  35. super(message);
  36. this.folder = folder;
  37. }
  38. /**
  39. * Returns the dead Folder object
  40. */
  41. public Folder getFolder() {
  42. return folder;
  43. }
  44. }