1. /*
  2. * @(#)FileNotFoundException.java 1.20 00/02/02
  3. *
  4. * Copyright 1994-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.io;
  11. /**
  12. * Signals that an attempt to open the file denoted by a specified pathname
  13. * has failed.
  14. *
  15. * <p> This exception will be thrown by the {@link FileInputStream}, {@link
  16. * FileOutputStream}, and {@link RandomAccessFile} constructors when a file
  17. * with the specified pathname does not exist. It will also be thrown by these
  18. * constructors if the file does exist but for some reason is inaccessible, for
  19. * example when an attempt is made to open a read-only file for writing.
  20. *
  21. * @author unascribed
  22. * @version 1.20, 02/02/00
  23. * @since JDK1.0
  24. */
  25. public class FileNotFoundException extends IOException {
  26. /**
  27. * Constructs a <code>FileNotFoundException</code> with
  28. * <code>null</code> as its error detail message.
  29. */
  30. public FileNotFoundException() {
  31. super();
  32. }
  33. /**
  34. * Constructs a <code>FileNotFoundException</code> with the
  35. * specified detail message. The string <code>s</code> can be
  36. * retrieved later by the
  37. * <code>{@link java.lang.Throwable#getMessage}</code>
  38. * method of class <code>java.lang.Throwable</code>.
  39. *
  40. * @param s the detail message.
  41. */
  42. public FileNotFoundException(String s) {
  43. super(s);
  44. }
  45. /**
  46. * Constructs a <code>FileNotFoundException</code> with a detail message
  47. * consisting of the given pathname string followed by the given reason
  48. * string. If the <code>reason</code> argument is <code>null</code> then
  49. * it will be omitted. This private constructor is invoked only by native
  50. * I/O methods.
  51. *
  52. * @since 1.2
  53. */
  54. private FileNotFoundException(String path, String reason) {
  55. super(path + ((reason == null)
  56. ? ""
  57. : " (" + reason + ")"));
  58. }
  59. }