Class FileIOException

All Implemented Interfaces:
Serializable

public class FileIOException extends IOException
This class extends IOException by also reporting a file name and line number at which the exception occurred. It requires use of a LineNumberReader.
See Also:
  • Field Details

    • fileName

      public final @Nullable String fileName
      The file being read when the IOException occurred.
    • lineNumber

      public final int lineNumber
      The line being read when the IOException occurred.
  • Constructor Details

    • FileIOException

      public FileIOException()
      Create a dummy FileIOException.
    • FileIOException

      public FileIOException(@Nullable Throwable cause)
      Create a FileIOException.
      Parameters:
      cause - the exception that occurred
    • FileIOException

      public FileIOException(@Nullable String message)
      Create a FileIOException with no known file name or line number (which is kind of pointless; you might as well just have a regular exception).
      Parameters:
      message - the detail message
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable Throwable cause)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      cause - the exception that occurred
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable String fileName, int lineNumber)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      fileName - the name of the file being read
      lineNumber - the line number to which the file has been read
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable Throwable cause, @Nullable String fileName, int lineNumber)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      cause - the exception that occurred
      fileName - the name of the file being read
      lineNumber - the line number to which the file has been read
    • FileIOException

      public FileIOException(@Nullable LineNumberReader reader, @Nullable Throwable cause)
      Create a FileIOException.
      Parameters:
      reader - the reader for the file being read (used for the line number only; no file name is known)
      cause - the exception that occurred
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable LineNumberReader reader)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      reader - indicates the line number at which the exception occurred; there is no known file name
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable LineNumberReader reader, @Nullable Throwable cause)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      reader - the reader for the file being read
      cause - the exception that occurred
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable LineNumberReader reader, @Nullable String fileName)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      reader - the reader for the file being read (used for the line number only)
      fileName - the name of the file being read
    • FileIOException

      public FileIOException(@Nullable LineNumberReader reader, @Nullable String fileName, @Nullable Throwable cause)
      Create a FileIOException.
      Parameters:
      reader - the reader for the file being read (used for the line number only)
      fileName - the name of the file being read
      cause - the exception that occurred
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable LineNumberReader reader, @Nullable String fileName, @Nullable Throwable cause)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      reader - the reader for the file being read (used for the line number only)
      fileName - the name of the file being read
      cause - the exception that occurred
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable LineNumberReader reader, File file)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      reader - the reader for the file being read (used for the line number only)
      file - the file being read (used for its name only)
    • FileIOException

      public FileIOException(@Nullable String message, @Nullable LineNumberReader reader, File file, @Nullable Throwable cause)
      Create a FileIOException.
      Parameters:
      message - the detail message for the exception
      reader - the reader for the file being read (used for the line number only)
      file - the file being read (used for its name only)
      cause - the exception that occurred
    • FileIOException

      public FileIOException(@Nullable LineNumberReader reader, File file, @Nullable Throwable cause)
      Create a FileIOException.
      Parameters:
      reader - the reader for the file being read (used for the line number only)
      file - the file being read (used for its name only)
      cause - the exception that occurred
  • Method Details

    • getMessage

      @SideEffectFree public String getMessage(@GuardSatisfied FileIOException this)
      Overrides:
      getMessage in class Throwable