Source Home >> Java Source 1.6.0 >> java.io.FileNotFoundException V 0.09
  • 01/*
  • 02 * @(#)FileNotFoundException.java 1.24 05/11/17
  • 03 *
  • 04 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  • 05 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  • 06 */
  • 07
  • 08package java.io;
  • 09
  • 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.24, 11/17/05
  • 23 * @since JDK1.0
  • 24 */
  • 25
  • 26public class FileNotFoundException extends IOException {
  • 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 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 path, String reason) {
  • 59 super(path + ((reason == null)
  • 60 ? ""
  • 61 : " (" + reason + ")"));
  • 62 }
  • 63
  • 64}

文件:FileNotFoundException.java
包名:java.io
类名:FileNotFoundException
继承:IOException
接口: