java.io

Class FileNotFoundException

Implemented Interfaces:
Serializable

public class FileNotFoundException
extends IOException

Signals that an attempt to open the file denoted by a specified pathname has failed.

This exception will be thrown by the FileInputStream, FileOutputStream, and RandomAccessFile constructors when a file with the specified pathname does not exist. It will also be thrown by these constructors if the file does exist but for some reason is inaccessible, for example when an attempt is made to open a read-only file for writing.

Since:
JDK1.0
See Also:
Serialized Form

Constructor Summary

FileNotFoundException()
Constructs a FileNotFoundException with null as its error detail message.
FileNotFoundException(String s)
Constructs a FileNotFoundException with the specified detail message.

Method Summary

Methods inherited from class java.lang.Throwable

fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

FileNotFoundException

public FileNotFoundException()
Constructs a FileNotFoundException with null as its error detail message.
Usages and Demos :

View More Examples of FileNotFoundException()
   1:         else {
   2:             throw new FileNotFoundException();
   3:         }
   4:     }
   5: }

View Full Code Here
   1:       switch(type) {
   2:         case 0: throw new FileNotFoundException();
   3:         case 1: throw new IOException();
   4:         case 2: throw new RuntimeException("Where am I?");
   5:         default: return;

View Full Code Here
   1:         else {
   2:             throw new FileNotFoundException();
   3:         }
   4:     }
   5: }

View Full Code Here
   1:             if (name == null)
   2:                 throw new FileNotFoundException();
   3: 
   4:             ObjectInputStream ois = new ObjectInputStream(new FileInputStream(name));
   5:             entries = (Map)ois.readObject();

View Full Code Here
   1:             if (file == null) {
   2:                 throw (new FileNotFoundException());
   3:             }
   4:             setDirectoryPath( file.getCanonicalPath() );
   5:         } catch (FileNotFoundException fnfe) {

View Full Code Here

FileNotFoundException

public FileNotFoundException(String s)
Constructs a FileNotFoundException with the specified detail message. The string s can be retrieved later by the Throwable.getMessage() method of class java.lang.Throwable.
Parameters:
s - the detail message.
Usages and Demos :

View More Examples of FileNotFoundException(String s)
   1:     catch(IOException ex2)
   2:       { throw new FileNotFoundException(""+_file); }
   3:   }
   4: 
   5:   public XFileOutputStream(File _file)

View Full Code Here
   1:     catch(IOException ex2)
   2:       { throw new FileNotFoundException(""+_file); }
   3:   }
   4: 
   5:   public XFileInputStream(File _file)

View Full Code Here
   1:     catch(IOException ex2)
   2:       { throw new FileNotFoundException(""+_file); }
   3:   }
   4: 
   5:   public XFileReader(File _file)

View Full Code Here
   1:             if (in == null) {
   2:                 throw new FileNotFoundException("/org/qedeq/kernel/xml/schema/qedeq.xsd");
   3:             }
   4:         ...
   5:             if (in == null) {
   6:                 throw new FileNotFoundException("/org/qedeq/kernel/xml/schema/parser.xsd");
   7:             }
   8:             InputSource inputSource = new InputSource(in);
   9:             inputSource.setPublicId(publicId);

View Full Code Here