jaroslav@1258: /* jaroslav@1258: * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved. jaroslav@1258: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jaroslav@1258: * jaroslav@1258: * This code is free software; you can redistribute it and/or modify it jaroslav@1258: * under the terms of the GNU General Public License version 2 only, as jaroslav@1258: * published by the Free Software Foundation. Oracle designates this jaroslav@1258: * particular file as subject to the "Classpath" exception as provided jaroslav@1258: * by Oracle in the LICENSE file that accompanied this code. jaroslav@1258: * jaroslav@1258: * This code is distributed in the hope that it will be useful, but WITHOUT jaroslav@1258: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jaroslav@1258: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jaroslav@1258: * version 2 for more details (a copy is included in the LICENSE file that jaroslav@1258: * accompanied this code). jaroslav@1258: * jaroslav@1258: * You should have received a copy of the GNU General Public License version jaroslav@1258: * 2 along with this work; if not, write to the Free Software Foundation, jaroslav@1258: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jaroslav@1258: * jaroslav@1258: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jaroslav@1258: * or visit www.oracle.com if you need additional information or have any jaroslav@1258: * questions. jaroslav@1258: */ jaroslav@1258: jaroslav@1258: package java.io; jaroslav@1258: jaroslav@1258: jaroslav@1258: /** jaroslav@1258: * Signals that an attempt to open the file denoted by a specified pathname jaroslav@1258: * has failed. jaroslav@1258: * jaroslav@1258: *
This exception will be thrown by the {@link FileInputStream}, {@link
jaroslav@1258: * FileOutputStream}, and {@link RandomAccessFile} constructors when a file
jaroslav@1258: * with the specified pathname does not exist. It will also be thrown by these
jaroslav@1258: * constructors if the file does exist but for some reason is inaccessible, for
jaroslav@1258: * example when an attempt is made to open a read-only file for writing.
jaroslav@1258: *
jaroslav@1258: * @author unascribed
jaroslav@1258: * @since JDK1.0
jaroslav@1258: */
jaroslav@1258:
jaroslav@1258: public class FileNotFoundException extends IOException {
jaroslav@1258: private static final long serialVersionUID = -897856973823710492L;
jaroslav@1258:
jaroslav@1258: /**
jaroslav@1258: * Constructs a FileNotFoundException
with
jaroslav@1258: * null
as its error detail message.
jaroslav@1258: */
jaroslav@1258: public FileNotFoundException() {
jaroslav@1258: super();
jaroslav@1258: }
jaroslav@1258:
jaroslav@1258: /**
jaroslav@1258: * Constructs a FileNotFoundException
with the
jaroslav@1258: * specified detail message. The string s
can be
jaroslav@1258: * retrieved later by the
jaroslav@1258: * {@link java.lang.Throwable#getMessage}
jaroslav@1258: * method of class java.lang.Throwable
.
jaroslav@1258: *
jaroslav@1258: * @param s the detail message.
jaroslav@1258: */
jaroslav@1258: public FileNotFoundException(String s) {
jaroslav@1258: super(s);
jaroslav@1258: }
jaroslav@1258:
jaroslav@1258: /**
jaroslav@1258: * Constructs a FileNotFoundException
with a detail message
jaroslav@1258: * consisting of the given pathname string followed by the given reason
jaroslav@1258: * string. If the reason
argument is null
then
jaroslav@1258: * it will be omitted. This private constructor is invoked only by native
jaroslav@1258: * I/O methods.
jaroslav@1258: *
jaroslav@1258: * @since 1.2
jaroslav@1258: */
jaroslav@1258: private FileNotFoundException(String path, String reason) {
jaroslav@1258: super(path + ((reason == null)
jaroslav@1258: ? ""
jaroslav@1258: : " (" + reason + ")"));
jaroslav@1258: }
jaroslav@1258:
jaroslav@1258: }