de.schlichtherle.io
Class ArchiveWarningException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by de.schlichtherle.io.ChainableIOException
                  extended by de.schlichtherle.io.ArchiveException
                      extended by 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

Constructor Summary
ArchiveWarningException(ArchiveException priorZipException, IOException cause)
           
ArchiveWarningException(ArchiveException priorZipException, String message)
           
ArchiveWarningException(ArchiveException priorZipException, String message, IOException cause)
           
 
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
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArchiveWarningException

public ArchiveWarningException(ArchiveException priorZipException,
                               String message)

ArchiveWarningException

public ArchiveWarningException(ArchiveException priorZipException,
                               String message,
                               IOException cause)

ArchiveWarningException

public ArchiveWarningException(ArchiveException priorZipException,
                               IOException cause)
Method Detail

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.