jaroslav@1258
|
1 |
/*
|
jaroslav@1258
|
2 |
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
|
jaroslav@1258
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
jaroslav@1258
|
4 |
*
|
jaroslav@1258
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
jaroslav@1258
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
jaroslav@1258
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
jaroslav@1258
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
jaroslav@1258
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
jaroslav@1258
|
10 |
*
|
jaroslav@1258
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
jaroslav@1258
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
jaroslav@1258
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
jaroslav@1258
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
jaroslav@1258
|
15 |
* accompanied this code).
|
jaroslav@1258
|
16 |
*
|
jaroslav@1258
|
17 |
* You should have received a copy of the GNU General Public License version
|
jaroslav@1258
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
jaroslav@1258
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
jaroslav@1258
|
20 |
*
|
jaroslav@1258
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
jaroslav@1258
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
jaroslav@1258
|
23 |
* questions.
|
jaroslav@1258
|
24 |
*/
|
jaroslav@1258
|
25 |
|
jaroslav@1258
|
26 |
package java.io;
|
jaroslav@1258
|
27 |
|
jaroslav@1258
|
28 |
|
jaroslav@1258
|
29 |
/**
|
jaroslav@1258
|
30 |
* Signals that an attempt to open the file denoted by a specified pathname
|
jaroslav@1258
|
31 |
* has failed.
|
jaroslav@1258
|
32 |
*
|
jaroslav@1258
|
33 |
* <p> This exception will be thrown by the {@link FileInputStream}, {@link
|
jaroslav@1258
|
34 |
* FileOutputStream}, and {@link RandomAccessFile} constructors when a file
|
jaroslav@1258
|
35 |
* with the specified pathname does not exist. It will also be thrown by these
|
jaroslav@1258
|
36 |
* constructors if the file does exist but for some reason is inaccessible, for
|
jaroslav@1258
|
37 |
* example when an attempt is made to open a read-only file for writing.
|
jaroslav@1258
|
38 |
*
|
jaroslav@1258
|
39 |
* @author unascribed
|
jaroslav@1258
|
40 |
* @since JDK1.0
|
jaroslav@1258
|
41 |
*/
|
jaroslav@1258
|
42 |
|
jaroslav@1258
|
43 |
public class FileNotFoundException extends IOException {
|
jaroslav@1258
|
44 |
private static final long serialVersionUID = -897856973823710492L;
|
jaroslav@1258
|
45 |
|
jaroslav@1258
|
46 |
/**
|
jaroslav@1258
|
47 |
* Constructs a <code>FileNotFoundException</code> with
|
jaroslav@1258
|
48 |
* <code>null</code> as its error detail message.
|
jaroslav@1258
|
49 |
*/
|
jaroslav@1258
|
50 |
public FileNotFoundException() {
|
jaroslav@1258
|
51 |
super();
|
jaroslav@1258
|
52 |
}
|
jaroslav@1258
|
53 |
|
jaroslav@1258
|
54 |
/**
|
jaroslav@1258
|
55 |
* Constructs a <code>FileNotFoundException</code> with the
|
jaroslav@1258
|
56 |
* specified detail message. The string <code>s</code> can be
|
jaroslav@1258
|
57 |
* retrieved later by the
|
jaroslav@1258
|
58 |
* <code>{@link java.lang.Throwable#getMessage}</code>
|
jaroslav@1258
|
59 |
* method of class <code>java.lang.Throwable</code>.
|
jaroslav@1258
|
60 |
*
|
jaroslav@1258
|
61 |
* @param s the detail message.
|
jaroslav@1258
|
62 |
*/
|
jaroslav@1258
|
63 |
public FileNotFoundException(String s) {
|
jaroslav@1258
|
64 |
super(s);
|
jaroslav@1258
|
65 |
}
|
jaroslav@1258
|
66 |
|
jaroslav@1258
|
67 |
/**
|
jaroslav@1258
|
68 |
* Constructs a <code>FileNotFoundException</code> with a detail message
|
jaroslav@1258
|
69 |
* consisting of the given pathname string followed by the given reason
|
jaroslav@1258
|
70 |
* string. If the <code>reason</code> argument is <code>null</code> then
|
jaroslav@1258
|
71 |
* it will be omitted. This private constructor is invoked only by native
|
jaroslav@1258
|
72 |
* I/O methods.
|
jaroslav@1258
|
73 |
*
|
jaroslav@1258
|
74 |
* @since 1.2
|
jaroslav@1258
|
75 |
*/
|
jaroslav@1258
|
76 |
private FileNotFoundException(String path, String reason) {
|
jaroslav@1258
|
77 |
super(path + ((reason == null)
|
jaroslav@1258
|
78 |
? ""
|
jaroslav@1258
|
79 |
: " (" + reason + ")"));
|
jaroslav@1258
|
80 |
}
|
jaroslav@1258
|
81 |
|
jaroslav@1258
|
82 |
}
|