Package org.apache.commons.io
Class IOExceptionList
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.apache.commons.io.IOExceptionList
- All Implemented Interfaces:
- Serializable,- Iterable<Throwable>
An IOException based on a list of Throwable causes.
 
 The first exception in the list is used as this exception's cause and is accessible with the usual
 Throwable.getCause() while the complete list is accessible with getCauseList().
 
- Since:
- 2.7
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionIOExceptionList(String message, List<? extends Throwable> causeList) Constructs a new exception caused by a list of exceptions.IOExceptionList(List<? extends Throwable> causeList) Constructs a new exception caused by a list of exceptions.
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidcheckEmpty(List<? extends Throwable> causeList, Object message) Throws this exception if the list is not null or empty.<T extends Throwable>
 TgetCause(int index) Gets the cause exception at the given index.<T extends Throwable>
 TGets the cause exception at the given index.Gets the cause list.getCauseList(Class<T> clazz) Works around Throwable and Generics, may fail at runtime depending on the argument value.iterator()Methods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
IOExceptionListConstructs a new exception caused by a list of exceptions.- Parameters:
- causeList- a list of cause exceptions.
 
- 
IOExceptionListConstructs a new exception caused by a list of exceptions.- Parameters:
- message- The detail message, see- Throwable.getMessage().
- causeList- a list of cause exceptions.
- Since:
- 2.9.0
 
 
- 
- 
Method Details- 
checkEmptypublic static void checkEmpty(List<? extends Throwable> causeList, Object message) throws IOExceptionList Throws this exception if the list is not null or empty.- Parameters:
- causeList- The list to test.
- message- The detail message, see- Throwable.getMessage().
- Throws:
- IOExceptionList- if the list is not null or empty.
- Since:
- 2.12.0
 
- 
getCauseGets the cause exception at the given index.- Type Parameters:
- T- type of exception to return.
- Parameters:
- index- index in the cause list.
- Returns:
- The list of causes.
 
- 
getCauseGets the cause exception at the given index.- Type Parameters:
- T- type of exception to return.
- Parameters:
- index- index in the cause list.
- clazz- type of exception to return.
- Returns:
- The list of causes.
 
- 
getCauseListGets the cause list.- Type Parameters:
- T- type of exception to return.
- Returns:
- The list of causes.
 
- 
getCauseListWorks around Throwable and Generics, may fail at runtime depending on the argument value.- Type Parameters:
- T- type of exception to return.
- Parameters:
- clazz- the target type
- Returns:
- The list of causes.
 
- 
iterator
 
-