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. import java.lang.*;
  7. /**
  8. * This exception is thrown by Folder methods, when those
  9. * methods are invoked on a non existent folder.
  10. *
  11. * @author John Mani
  12. */
  13. public class FolderNotFoundException extends MessagingException {
  14. transient private Folder folder;
  15. /**
  16. * Constructs a MessagingException with no detail message.
  17. */
  18. public FolderNotFoundException() {
  19. super();
  20. }
  21. /**
  22. * Constructs a MessagingException with the specified folder.
  23. * @param folder the Folder
  24. * @since JavaMail 1.2
  25. */
  26. public FolderNotFoundException(Folder folder) {
  27. super();
  28. this.folder = folder;
  29. }
  30. /**
  31. * Constructs a MessagingException with the specified folder and
  32. * the specified detail message.
  33. * @param folder the Folder
  34. * @param s the detail message
  35. * @since JavaMail 1.2
  36. */
  37. public FolderNotFoundException(Folder folder, String s) {
  38. super(s);
  39. this.folder = folder;
  40. }
  41. /**
  42. * Constructs a MessagingException with the specified detail message
  43. * and the specified folder.
  44. * @param s the detail message
  45. * @param folder the Folder
  46. */
  47. public FolderNotFoundException(String s, Folder folder) {
  48. super(s);
  49. this.folder = folder;
  50. }
  51. /**
  52. * Returns the offending Folder object.
  53. * @return the Folder object. Note that the returned value can be
  54. * <code>null</code>.
  55. */
  56. public Folder getFolder() {
  57. return folder;
  58. }
  59. }