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 an attempt is made to open a folder
  8. * read-write access when the folder is marked read-only. <p>
  9. *
  10. * The getMessage() method returns more detailed information about the
  11. * error that caused this exception. <p>
  12. *
  13. * @author Jim Glennon
  14. */
  15. public class ReadOnlyFolderException extends MessagingException {
  16. transient private Folder folder;
  17. /**
  18. * Constructs a MessagingException with the specified folder.
  19. * @param folder the Folder
  20. * @since JavaMail 1.2
  21. */
  22. public ReadOnlyFolderException(Folder folder) {
  23. this(folder, null);
  24. }
  25. /**
  26. * Constructs a MessagingException with the specified folder and
  27. * the specified detail message.
  28. * @param folder the Folder
  29. * @param message the detailed error message
  30. * @since JavaMail 1.2
  31. */
  32. public ReadOnlyFolderException(Folder folder, String message) {
  33. super(message);
  34. this.folder = folder;
  35. }
  36. /**
  37. * Returns the dead Folder object.
  38. * @since JavaMail 1.2
  39. */
  40. public Folder getFolder() {
  41. return folder;
  42. }
  43. }