@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class CompositeIOException extends IOException
Modifier and Type | Field and Description |
---|---|
static int |
EXCEPTION_LIMIT
The maximum number of exceptions that can be reported by a single
CompositeIOException . |
Constructor and Description |
---|
CompositeIOException(String message,
IOException... exceptions) |
CompositeIOException(String message,
List<IOException> exceptions)
Construct a new
CompositeIOException where the given list of
exceptions are added as suppressed exceptions to the new exception. |
Modifier and Type | Method and Description |
---|---|
UncheckedIOException |
asUncheckedIOException() |
List<IOException> |
getExceptions() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final int EXCEPTION_LIMIT
CompositeIOException
.
The number of exceptions is limited to avoid pathological cases where
a huge number of exceptions could lead to excessive memory usage.
For example, if the number of exceptions was unlimited, a call to
Util.deleteRecursive
could fail with a
CompositeIOException
that contains an exception for every
single file inside of the directory.
public CompositeIOException(String message, @NonNull List<IOException> exceptions)
CompositeIOException
where the given list of
exceptions are added as suppressed exceptions to the new exception.
If the given list of exceptions is longer than EXCEPTION_LIMIT
,
the list will be truncated to that length, and a message indicating the
number of discarded exceptions will be appended to the original message.
public CompositeIOException(String message, IOException... exceptions)
CompositeIOException(String, List)
public List<IOException> getExceptions()
public UncheckedIOException asUncheckedIOException()
Copyright © 2004–2021. All rights reserved.