de.schlichtherle.io
Class ArchiveWarningException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
de.schlichtherle.io.ChainableIOException
de.schlichtherle.io.ArchiveException
de.schlichtherle.io.ArchiveWarningException
- All Implemented Interfaces:
- Serializable, Cloneable
- Direct Known Subclasses:
- ArchiveBusyWarningException
public class ArchiveWarningException
- extends ArchiveException
Represents a chain of exceptions thrown by the File.umount()
and
File.update()
methods to indicate an error condition which
does not incur loss of data and may be ignored.
Both methods catch any exceptions occuring throughout their processing
and store them in an exception chain until all archive files have been
updated.
Finally, if the exception chain is not empty, it's reordered and thrown
so that if its head is an instance of ArchiveWarningException
,
only instances of this class or its subclasses are in the chain, but no
instances of ArchiveException
or its subclasses (except
ArchiveWarningException
, of course).
This enables client applications to do a simple case distinction with a
try-catch-block like this to react selectively:
try {
File.umount();
} catch (ArchiveWarningException warning) {
// Only warnings have occured and no data has been lost - ignore this.
} catch (ArchiveException error) {
// Some data has been lost - panic!
error.printStackTrace();
}
- Since:
- TrueZIP 6.0
- Version:
- TrueZIP 6.7
- Author:
- Christian Schlichtherle
- See Also:
- Serialized Form
Method Summary |
int |
getPriority()
Returns the priority for this class of exception. |
Methods inherited from class de.schlichtherle.io.ChainableIOException |
clone, getAppearance, getMaxPrintExceptions, getPrior, initCause, initCause, printStackTrace, printStackTrace, printStackTrace, printStackTrace, setMaxPrintExceptions, sortAppearance, sortPriority |
ArchiveWarningException
public ArchiveWarningException(ArchiveException priorZipException,
String message)
ArchiveWarningException
public ArchiveWarningException(ArchiveException priorZipException,
String message,
IOException cause)
ArchiveWarningException
public ArchiveWarningException(ArchiveException priorZipException,
IOException cause)
getPriority
public int getPriority()
- Description copied from class:
ChainableIOException
- Returns the priority for this class of exception.
This should always return the same value for all instances of a
particular class.
- Overrides:
getPriority
in class ChainableIOException
- Returns:
- 0 for all instances of this class.