KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > io > FileNotFoundException


1 /*
2  * @(#)FileNotFoundException.java 1.23 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.io;
9
10
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.23, 12/19/03
23  * @since JDK1.0
24  */

25
26 public class FileNotFoundException extends IOException JavaDoc {
27
28     /**
29      * Constructs a <code>FileNotFoundException</code> with
30      * <code>null</code> as its error detail message.
31      */

32     public FileNotFoundException() {
33     super();
34     }
35
36     /**
37      * Constructs a <code>FileNotFoundException</code> with the
38      * specified detail message. The string <code>s</code> can be
39      * retrieved later by the
40      * <code>{@link java.lang.Throwable#getMessage}</code>
41      * method of class <code>java.lang.Throwable</code>.
42      *
43      * @param s the detail message.
44      */

45     public FileNotFoundException(String JavaDoc s) {
46     super(s);
47     }
48
49     /**
50      * Constructs a <code>FileNotFoundException</code> with a detail message
51      * consisting of the given pathname string followed by the given reason
52      * string. If the <code>reason</code> argument is <code>null</code> then
53      * it will be omitted. This private constructor is invoked only by native
54      * I/O methods.
55      *
56      * @since 1.2
57      */

58     private FileNotFoundException(String JavaDoc path, String JavaDoc reason) {
59     super(path + ((reason == null)
60               ? ""
61               : " (" + reason + ")"));
62     }
63
64 }
65
Popular Tags