01: /*
02: * @(#)FileNotFoundException.java 1.28 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: *
26: */
27:
28: package java.io;
29:
30: /**
31: * Signals that an attempt to open the file denoted by a specified pathname
32: * has failed.
33: *
34: * <p> This exception will be thrown by the {@link FileInputStream}, {@link
35: * FileOutputStream}, and {@link RandomAccessFile} (NOTE: <B>RandomAccessFile</B>
36: * is found in J2ME CDC profiles such as J2ME Foundation Profile)
37: * constructors when a file with the specified pathname does not exist.
38: * It will also be thrown by these constructors if the file does exist but
39: * for some reason is inaccessible, for example when an attempt is made to
40: * open a read-only file for writing.
41: *
42: * @author unascribed
43: * @version 1.20, 02/02/00
44: * @since JDK1.0
45: */
46:
47: public class FileNotFoundException extends IOException {
48:
49: /**
50: * Constructs a <code>FileNotFoundException</code> with
51: * <code>null</code> as its error detail message.
52: */
53: public FileNotFoundException() {
54: super ();
55: }
56:
57: /**
58: * Constructs a <code>FileNotFoundException</code> with the
59: * specified detail message. The string <code>s</code> can be
60: * retrieved later by the
61: * <code>{@link java.lang.Throwable#getMessage}</code>
62: * method of class <code>java.lang.Throwable</code>.
63: *
64: * @param s the detail message.
65: */
66: public FileNotFoundException(String s) {
67: super (s);
68: }
69:
70: /**
71: * Constructs a <code>FileNotFoundException</code> with a detail message
72: * consisting of the given pathname string followed by the given reason
73: * string. If the <code>reason</code> argument is <code>null</code> then
74: * it will be omitted. This private constructor is invoked only by native
75: * I/O methods.
76: *
77: * @since 1.2
78: */
79: private FileNotFoundException(String path, String reason) {
80: super (path + ((reason == null) ? "" : " (" + reason + ")"));
81: }
82:
83: }
|