Class FileBatchJob.ExceptionOccurrence

    • Field Detail

      • UNKNOWN_OFFSET

        public static final long UNKNOWN_OFFSET
        Marker for the case when we couldn't find an offset for the outputstream.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExceptionOccurrence

        public ExceptionOccurrence​(File file,
                                   long fileOffset,
                                   long outputOffset,
                                   Exception exception)
        Standard Constructor for ExceptionOccurrence.
        Parameters:
        file - The file that caused the exception.
        fileOffset - The relevant offset into the file when the exception happened (e.g. the start of an ARC record).
        outputOffset - The offset we were at in the outputstream when the exception happened.
        exception - The exception thrown. This exception must be serializable.
        See Also:
        for details on the parameters.
      • ExceptionOccurrence

        public ExceptionOccurrence​(boolean inInitialize,
                                   long outputOffset,
                                   Exception exception)
        Constructor for ExceptionOccurrence when an exception happened during initialize() or finish().
        Parameters:
        inInitialize - True if the exception happened in initialize()
        outputOffset - Current offset in the output stream, or UNKNOWN_OFFSET if the offset cannot be found.
        exception - The exception that was thrown.
    • Method Detail

      • getFileName

        public String getFileName()
        Get the name of the file that this exception occurred in.
        Returns:
        Name of the file that this exception occurred in, or null if it happened during initialize() or finish().
      • getFileOffset

        public long getFileOffset()
        Get the offset into the file that this exception occurred at. This location may not be exactly where the problem that caused the exception occurred, but may be e.g. at the start of a corrupt record.
        Returns:
        Offset into the file that this exception occurred at, or UNKNOWN_OFFSET if it happened during initialize() or finish().
      • getOutputOffset

        public long getOutputOffset()
        Offset of the output stream when this exception occurred.
        Returns:
        Offset in output stream, or UNKNOWN_OFFSET if the offset could not be determined.
      • getException

        public Exception getException()
        The exception that was thrown.
        Returns:
        An exception.
      • isInitializeException

        public boolean isInitializeException()
        Returns true if the exception was thrown during initialize(). In that case, no processing has taken place, but finish() has been called.
        Returns:
        true if the exception was thrown during initialize()
      • isFinishException

        public boolean isFinishException()
        Returns true if the exception was thrown during finish().
        Returns:
        true if the exception was thrown during finish().
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        a Human readable representation of this ExceptionOccurence object.